Statistics
| Branch: | Tag: | Revision:

root / test @ 570274e4

# Date Author Comment
daa49d6f 12/18/2012 03:06 pm Michael Hanselmann

Fix error during cluster initialization due to hv_kvm

Commit 141d148 was a bit too enthusiastic. The three parameters added to
the list of parameters to be checked default to a value not evaluating
to false, leading to a failure on cluster initialization....

141d1489 12/17/2012 06:24 pm Michael Hanselmann

Add test for SPICE parameter list, add missing ones

“_SPICE_ADDITIONAL_PARAMS” is supposed to be the full list of
SPICE-related KVM hypervisor parameters with the exception of
“HV_KVM_SPICE_BIND”. The new test checks if all parameters starting with
“HV_KVM_SPICE_*” are included. Three previously missing parameters are...

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

99e222b1 12/13/2012 01:29 pm Michael Hanselmann

Add RPC for setting watcher pause

The watcher pause file should be set/unset on all nodes at once, not
only the master node. For that a new RPC is needed.

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

6ec28bc6 12/13/2012 01:28 pm Michael Hanselmann

Rename test for backend._CommonRestrictedCmdCheck

“TestWriteFile” was not renamed when adding the file based on
“ganeti.utils.io_unittest-runasroot.py”.

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

383477e9 12/13/2012 01:27 pm Michael Hanselmann

jqueue: Improve inotify error reporting

This addresses issue 218. When the number of inotify watches is
exhausted, for example by being set too low from the beginning or by
other programs, waiting for a job to change would just report a lost job
(e.g. “Error checking job status: Job with id 7817 lost”)....

e37f47d3 12/13/2012 01:27 pm Michael Hanselmann

Improve test for tools.ensure_dirs

- Add more checks, some of them are deliberately redundant
- Descriptive error messages
- Add comment describing order to “tools.ensure_dirs”
- Avoid copying a list in an assertion in “tools.ensure_dirs”

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

3e3ddbf0 12/12/2012 03:18 pm Constantinos Venetsanopoulos

Remove checks wrt IDISK_PARAMS from OpCode level

Change the "--disks" option validation, to just check the format
of the dict and do not check whether the keys are included in the
IDISK_PARAMS constant at OpCode level. This allows the passing of
arbitrary parameters at the CLI, which will then be logically...

4a3dd52d 12/11/2012 01:01 pm Michael Hanselmann

Add utility function to create frozenset with unique values

When used instead of a plain call to “frozenset”, this would have
avoided the issue fixed in commit e2dd6ec. The new function is located
in the “compat” module as it will be used at module load time in most...

bc826292 12/07/2012 02:47 pm Michael Hanselmann

Export error codes from RAPI client module

Until now the error codes were not available from the RAPI client
module. A newly added unit test ensures all error codes are contained in
“ECODE_ALL”, as well as ensuring consistency between the RAPI client and...

e9a81214 12/07/2012 02:35 pm Michael Hanselmann

mcpu: Verify node allocation lock mode

Add verification code to mcpu to check an LU's locks. Two whitelists are
provided to exclude LUs from the two tests.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

e712e5b8 12/06/2012 06:19 pm Michael Hanselmann

Fix node-daemon-setup test with older pyOpenSSL

Older versions use “-----BEGIN RSA PRIVATE KEY-----” instead of
“-----BEGIN PRIVATE KEY-----”.

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

69e5fefc 12/06/2012 04:07 pm Michael Hanselmann

Add tool to configure node daemon

The design for this is in “doc/design-node-add.rst”. The tool receives a
JSON data structure on stdin and configures the node's daemon after
verifying the received values.

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

3c631ea2 12/05/2012 05:35 pm Michael Hanselmann

jqueue: Don't modify input opcode when changing priority

Commit 4679547 implemented the ability to change job's priority after it
was submitted. The code contained a bug whereby it would modify the
input data for an opcode, something the job queue shouldn't do (logical...

fb60bc6a 12/04/2012 07:54 pm Michael Hanselmann

iallocator: Add node whitelist

In the future instance creations might have a lock on all nodes as was
the case until the implementation of opportunistic locking. Nodes for
which the lock is not held will be shown to the iallocator plugin as if
they were marked offline....

d242923c 12/04/2012 11:22 am Michael Hanselmann

utils.text: Function to verify MAC address prefix

The network management code needs to verify a MAC address prefix.
Instead of (ab)using NormalizeAndValidateMac, clean code should be used.
Unit tests for NormalizeAndValidateMac are updated and new ones for...

0602cef3 12/03/2012 04:33 pm Michael Hanselmann

Factorize code for checking node daemon certificate

This code is going to be used by a new utility for setting up the node
daemon. Unit tests are updated/added.

Additionally, the certificate and key stored in “server.pem” are
verified, too.

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

a95c53ea 12/03/2012 03:56 pm Michael Hanselmann

locking: Implement opportunistic locking in LockSet

This patch adds a new parameter to “LockSet.acquire” named
“opportunistic”. When enabled the lockset will try to acquire as many
locks as possible, but it won't wait for them (with the exception of the
lockset-internal lock in case the whole set is acquired). This is...

9b4329e9 12/03/2012 03:04 pm Michael Hanselmann

Add ssconf function to read all files

Configuring a node daemon on a newly added node will need all ssconf
values.

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

cc7f5bfc 12/03/2012 03:03 pm Michael Hanselmann

ssconf: Add dry-run support for writing files

A new utility for configuring the node daemon will support a dry-run
mode. This patch adds the necessary functionality to
“ssconf.SimpleStore” and provides comprehensive tests for
“SimpleStore.WriteFiles”. To enable the latter, a testing-only parameter...

29a32ce5 12/03/2012 03:03 pm Michael Hanselmann

ssconf: Add function to verify keys

The new utility for configuring the node daemon will have to check
whether it received valid ssconf names.

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

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

e055a2ab 11/30/2012 10:14 am Dimitris Aragiorgis

Introduce ht.TMaybeValueNone and ht.TValueNone

TValueNone checks if a value is "none" and TMaybeValueNone is a wrapper
of TOr(TValueNone, x). This is used by OpNetworkSetParam in order to
reset a network value (e.g. mac_prefix, gateway, etc.)

Signed-off-by: Dimitris Aragiorgis <>...

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

16091a6e 11/29/2012 01:33 pm Michael Hanselmann

Fix type descriptions in RAPI documentation

This patch adds descriptors to the “_CheckCIDR*” functions in opcodes
and improves the descriptions generated by “ht.TInstanceOf”, thereby
indirectly fixing bad type descriptions in the RAPI documentation.

Before this patch:...

dffa96d6 11/28/2012 01:48 pm Michael Hanselmann

Move cluster verification out of prepare-node-join

A new tool for configuring the node daemon will also have to verify the
cluster name, so it's better to have this function in a central place.
In the process of moving it to ssconf it is also changed to use...

911dfc49 11/28/2012 01:48 pm Michael Hanselmann

ssconf: Verify file size when reading, add some tests

Until now ssconf would limit the amount read from files to 128 KiB and
silently ignored files larger than that. With this patch a check is
added by using fstat(2) on the file descriptor while it's being read....

5d630c22 11/27/2012 12:54 pm Michael Hanselmann

Factorize code to load and verify JSON

A new tool to configure the node daemon will also have to load and
verify JSON data.

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

796b5152 11/27/2012 12:54 pm Michael Hanselmann

Factorize logging setup in tools

Most tools had their own “SetupLogging” function, but they were all
essentially the same. This patch adds a generic version to “utils.log”
and provides unit tests.

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

8c811986 11/26/2012 01:26 pm Michael Hanselmann

locking: Method to check if LockSet is fully acquired

A new method is added to check whether the LockSet-internal lock is
held. This is the case after LockSet.acquire was called with
locking.ALL_SET.

Unit tests are updated, including one where the list of names must be...

8716b1db 11/23/2012 06:19 pm Michael Hanselmann

Add new lock level for node allocations

The new lock is similar to the BGL in the sense that it has its own
level and there is only one. It is called “node allocation lock”.
Logical units will use it to synchronize with instance creations, which
in turn will start using opportunistic locks on nodes....

fd9f58fd 11/23/2012 04:24 pm Iustin Pop

Introduce a TMaybe combinator

We have many cases in the code where we write TOr(TNone, a), so let's
introduce a combinator that simplifies this case.

Beside replacing the above with TMaybe(a), I did a few other parameter
fixes:

- noop change TOr(TNone, TDict) to TMaybeDict...

2b5b0fe9 11/23/2012 04:24 pm Iustin Pop

Replace dict() with {}

The network patches and an existing test added function-call based
dict construction as opposed to literal sintax.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michele Tartara <>

405bffe2 11/21/2012 03:43 pm Michael Hanselmann

Rename leftovers from remote to restricted commands

As per Iustin Pop's suggestion in <> on
<>.

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

42bd26e8 11/21/2012 03:43 pm Michael Hanselmann

backend: Rename RunRemoteCommand to RunRestrictedCmd

As per Iustin Pop's suggestion in <> on
<>.

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

6252c0bd 11/21/2012 08:23 am Michael Hanselmann

Add tests for repr in locking classes

“locking.PipeCondition” and “locking.SharedLock” define “__repr__”,
which until now was not tested at all.

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

8c114acd 11/21/2012 08:23 am Michael Hanselmann

test/*.py: s/'/"/

Now that 2.6 is essentially finished and 2.7 going to be branched
soon-ish, I thought it would be a good moment to replace some single
quotes in test/*.py. Merge pains should be limited.

In one place in test/ganeti.locking_unittest.py, spaces are added for...

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

0ef4d576 11/21/2012 03:44 am Michael Hanselmann

locking: Add test for downgrade without names

Until now there was no test for calling “LockSet.downgrade” without
specifying any names.

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

6e8091f9 11/20/2012 07:51 pm Dimitris Aragiorgis

Fixes to pass unittests (make check)

Signed-off-by: Dimitris Aragiorgis <>
Reviewed-by: Iustin Pop <>

a52f8e72 11/20/2012 01:02 pm Michele Tartara

Add DRBD parser unit tests

This adds tests that existing test files can be parsed by the Haskell
parser as well, plus one new test file.

Signed-off-by: Michele Tartara <>
Reviewed-by: Iustin Pop <>

2c9fa1ff 11/20/2012 11:16 am Iustin Pop

Cleanup ht's use of positive/strictpositive

Currently, ht.py uses a bad terminology for positive/non-negative
numbers. Per http://en.wikipedia.org/wiki/Positive_number, this is the
correct terminology:

- A number is positive if it is greater than zero.
- A number is negative if it is less than zero....

e4d745a7 11/19/2012 03:12 pm Michael Hanselmann

Add opcode for running commands remotely

The opcode doesn't pay attention to the build-time flag to enable or
disable restricted commands. In a cluster different nodes could have
different settings.

Node locks are acquired in shared mode by default, but the use of an...

1a2eb2dc 11/16/2012 04:10 pm Michael Hanselmann

backend: Implement remote commands

As per design document (doc/design-remote-commands.rst), a number of
rather strict tests is applied to any incoming request, a delay is
inserted upon errors and returned error messages are very generic
(unless it's the actual command that failed). There are unit tests for...

de959245 11/16/2012 03:57 pm Michael Hanselmann

Add unit test for RAPI handler access definitions

- Ensure query-related resources have the same access permissions
(specifically “/2/query/*” and “/2/*/console”)
- Check access permission consistency (write implies read)

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

5e12acfe 11/16/2012 03:57 pm Michael Hanselmann

rapi: Add new user option for querying

This was requested in issue 301. Before this patch, requests to
“/2/query/*” and “/2/instances/*/console” would require authentication
with a user with write access. Since that is not strictly necessary, a
new user option named “read” is added....

3e0b97b5 11/14/2012 10:44 am Michael Hanselmann

Don't check for remote command directory as file storage

This test does not work properly if localstatedir is not “/etc”.

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

df99f3a9 11/14/2012 10:16 am Michael Hanselmann

pathutils: Add directory for remote commands

Also add tests to ensure it's never allowed as a file storage path. A
constant for the lock file is also added.

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

23b9930c 11/14/2012 10:15 am Michael Hanselmann

Add previously missing node daemon GID to getent mock

The UID is there, the GID wasn't.

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

ebfb2f46 11/14/2012 10:15 am Michael Hanselmann

Add test utility to count calls to function

In some cases it's nice to verify a function has been called exactly N
times. This is going to be used in tests for remote commands.

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

105f0d47 11/13/2012 10:21 pm Michael Hanselmann

Add new test for RAPI

Unlike existing tests, this actually tests RAPI at the interface with
the HTTP server. This way authentification can also be tested. A test
for “/2/query/…” is included as it's a bit special.

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

f63ffb37 11/13/2012 09:28 pm Michael Hanselmann

Expose changing job priority via LUXI

A new LUXI request is added, in both Python and Haskell.

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

9a2564e7 11/13/2012 09:20 pm Michael Hanselmann

workerpool: Add method to change task's priority

Using the task ID a pending task's priority can be changed. This will be
used to change the priority of jobs in the workerpool.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

bba69414 11/13/2012 09:20 pm Michael Hanselmann

workerpool: Preserve task number when deferring

When a task is deferred it should receive the same task ID upon being
returned to the pool.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

4679547e 11/13/2012 09:20 pm Michael Hanselmann

jqueue: Allow changing of job priority

This is due to a feature request. Sometimes one wants to change the
priority of a job after it has been submitted, e.g. after submitting an
important job only to later notice many other pending jobs which will be
processed first. Priority changes only take effect at the next lock...

125b74b2 11/13/2012 09:20 pm Michael Hanselmann

workerpool: Change data structure for priority change

To prepare for the addition of a new function allowing changing a
pending task's priority, the internal data structure is slightly
changed. The (optional) task ID is stored as part of the task entry. A...

09b72783 11/12/2012 06:51 pm Michael Hanselmann

RunCmd: Expose "postfork" callback

The “_postfork_fn” parameter was only used for tests until now. To
implement a good locking scheme, remote commands must also make use of
this callback to release a lock when the command was successfully
started (but did not yet finish)....

e4e59de8 11/08/2012 04:40 pm Michael Hanselmann

jqueue/mcpu: Determine priority using callback

Instead of being given the priority for acquiring locks by means of a
parameter, mcpu will now call back. This is in preparation for
implementing a command to change a job's priority on the fly and allows
to change it while locks are being acquired (taking effect on the next...

8af734f8 11/08/2012 04:15 pm Michael Hanselmann

Merge branch 'devel-2.6'

  • devel-2.6:
    http/__init__.py: Remove extraneous argument
    rapi.testutils: Add utility to format HTTP headers
    rapi.testutils: Return headers from mock utility
    http: Add wrapper for mimetools.Message
    Add missing tests for commit f0d2286...
22105827 11/08/2012 04:08 pm Michael Hanselmann

Merge branch 'stable-2.6' into devel-2.6

  • stable-2.6:
    http/__init__.py: Remove extraneous argument
    rapi.testutils: Add utility to format HTTP headers
    rapi.testutils: Return headers from mock utility
    http: Add wrapper for mimetools.Message
    Add missing tests for commit f0d2286...
0351944b 11/08/2012 03:20 pm Michael Hanselmann

rapi.testutils: Return headers from mock utility

A newly added test for RAPI will also verify the returned headers. A
test in ganeti.rapi.client_unittest.py is split into smaller stand-alone
tests.

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

7a70541e 11/07/2012 06:57 pm Michael Hanselmann

Add missing tests for commit f0d2286

Commit f0d2286 changed the logic of
gnt_instance._ConvertNicDiskModifications to also allow a parameter
named “modify”. Unfortunately the corresponding unittest was not
updated. An “if”/“else” condition is also merged....

10b86782 11/06/2012 07:59 pm Michael Hanselmann

Add utility to check if file is executable

This replaces direct calls to “os.access” and
“os.path.exists”/“os.path.isfile”.

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

2826897c 11/06/2012 04:00 pm Michael Hanselmann

utils.io: Improve handling of double and single slashes

Up until now “IsBelowDir("/", …)” would never return True. The reason
was that an additional slash was added to the root path resulting in
“//", which is “implementation-defined” in posix and treated specially...

8e09e801 11/01/2012 07:44 pm Michael Hanselmann

Merge branch 'devel-2.6'

  • devel-2.6:
    Fix typo in gnt-instance man page
    jqueue: Return jobs to queue when shutting down
    gnt-debug delay: Add "--submit" option
    Make hostname checks uniform between instance rename and add
    Improve logging of new job submissions...
dc2cc657 11/01/2012 06:39 pm Michael Hanselmann

Merge branch 'stable-2.6' into devel-2.6

  • stable-2.6:
    Fix typo in gnt-instance man page
    jqueue: Return jobs to queue when shutting down
    gnt-debug delay: Add "--submit" option
    Make hostname checks uniform between instance rename and add
    Improve logging of new job submissions...
942e2262 11/01/2012 05:48 pm Michael Hanselmann

jqueue: Return jobs to queue when shutting down

When a job is still waiting for locks and the queue is shutting down,
they should be returned and not actually start processing. Until now
jobs which transitioned from “queued” to “waiting” were already
considered to be running as far as the shutdown code was concerned....

b1adc12e 11/01/2012 05:06 pm Michael Hanselmann

Remove duplicate workerpool test

Commit 52c47e4e (July 2010) added the exact test twice, probably due to
a copy & paste error.

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

7939f60c 10/26/2012 05:35 pm Michael Hanselmann

cfgupgrade: Write file for file storage paths

When file storage is used this file is now mandatory.

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

78062de9 10/26/2012 05:33 pm Michael Hanselmann

Make Paramiko an optional dependency for listrunner

With the move away from “setup-ssh”, Paramiko is no longer necessary to
configure SSH on nodes.

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

5484cda5 10/26/2012 05:27 pm Michael Hanselmann

ssh: Add function to get all of user's SSH files

This new function returns the file paths for all of a user's SSH-related
files (RSA, DSA and authorized_keys).

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

d5d76ab2 10/26/2012 05:27 pm Michael Hanselmann

RunCmd: Support standard input file descriptor

This patch changes “utils.RunCmd” to accept a file-like object or a
numeric file descriptor which will be used as the command's standard
input. One use-case will be to pass all necessary data to
“prepare-node-join”....

340ae7da 10/26/2012 03:37 pm Michael Hanselmann

prepare-node-join: Swap private and public keys

Other places, such as “ssh.GetUserFiles”, use a structure where the
private key comes before the private key. Until now prepare-node-join
did the opposite, that is the public key came first. To avoid confusion...

910ef222 10/26/2012 03:37 pm Michael Hanselmann

prepare-node-join: Use public key directly for auth…_keys

A public key already includes the necessary prefix (“ssh-rsa” or
“ssh-dss”), so there is no need to add it again.

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

7bd70e6b 10/26/2012 03:35 pm Michael Hanselmann

ssh.GetUserFiles: Parameter to disable directory check

Without this parameter, either an error would be raised or “.ssh” would
have to be created. Now it is possible to retrieve the paths without
requiring the “.ssh” directory to exist.

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

cd93a0ec 10/25/2012 06:47 pm Iustin Pop

Remove unused cache implementation

Note that this commit has no Makefile.am changes, as the files were
not actually used. So it's better to actually remove them.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

23e3c9b7 10/25/2012 03:18 pm Michael Hanselmann

bdev: Add verification for file storage paths

An earlier version of this patch series verified all paths in cmdlib in
the master daemon. With this change all that verification code is moved
to bdev to run inside the node daemon. The checks are much stricter...

d12b9f66 10/23/2012 06:32 pm Michael Hanselmann

Add initial implementation of prepare-node-join

This is a new tool as per the design document “design-ssh-setup”. It
receives a JSON data structure on its standard input and configures the
SSH daemon and root's SSH keys accordingly. Unit tests are included....

8a3c9e8a 10/23/2012 03:59 pm Michael Hanselmann

ssh.GetUserFiles: RSA support, unit tests

This patch changes “ssh.GetUserFiles” to support two different kinds of
SSH keys, RSA and DSA. Before it would always use DSA. Newly written
unit tests are included.

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

0232b768 10/19/2012 02:43 pm Michael Hanselmann

Compare significant fields only for simple SSH keys

For simple SSH keys, that is those without options such as
“command="…"”, only the first two parts need to be compared. The third
field is a free-form comment.

This patch changes the comparison used in...

2f96c43c 10/18/2012 07:58 pm Michael Hanselmann

test/*.py: Replace '' with ""

There might be more, but at least replace all these low-hanging fruits.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

6b6e335b 10/17/2012 04:13 pm Dato Simó

Group.hs: add 'allTags'; adjust loaders and test data for it

This commit adds a Group.allTags field to store the tags of node groups,
and teaches each loader backend in HTools to populate it (additionally, the
IAllocator class in lib/cmdlib.py now includes tags for groups too). Test...

0397694e 10/17/2012 04:13 pm Dato Simó

htools-excl.test: add test case for exclusion tags in hbal

In preparation for future modifications in the exclusion tags field, add a
test that verifies that exclusion tags are being honored: in a test cluster
with two instances of the same exclusion group in each node, hbal should...

e1c701e7 10/17/2012 02:12 pm Michael Hanselmann

gnt-job cancel: Confirmation and selection of jobs

New parameters, “--pending”, “--queued” and “--waiting”, are added to
select all jobs in the respective state. If one of those options is used
and “--force” is not given, the user is asked to confirm the operation....

7bb6e137 10/16/2012 06:13 pm Michael Hanselmann

Replace custom algorithm in constants unittest

There is no need for the “_IsUniqueSequence” function anymore, it can
easily be replaced by utils.FindDuplicates. Also, pass the message as a
keyword parameter and use the more commonly used assert* functions....

1eaddbc6 10/16/2012 06:05 pm Michael Hanselmann

Add new constant for pending job status

This constant contains the job status' “queued”, “waiting” and
“cancelled”.

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

fe4f6dca 10/11/2012 12:56 pm Michael Hanselmann

vcluster: Don't virtualize /etc/hosts path

/etc/hosts is a bit special as it's a system-wide file and the virtual
cluster/node root doesn't apply. The modification of /etc/hosts should
be disabled in virtual clusters. If it isn't, however, the vcluster
functions would raise an exception complaining about a path outside of...

6a74f584 10/11/2012 12:38 pm Michael Hanselmann

Merge branch 'devel-2.6'

  • devel-2.6:
    verify-disks: Explicitely state nothing has to be done
    Add list of design documents implemented in version 2.6
    Better list of replace-disks arguments + typos fixed
    jqueue: Look at archived jobs when watching
    Show old primary/secondary node on disk replacement...
8a3cd185 10/11/2012 12:23 pm Michael Hanselmann

jqueue: Add new in-memory attribute for archived jobs

This attribute is set to True for jobs which were restored from an
archived file. A new filter will act on this field.

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

52aa1efa 10/11/2012 12:23 pm Michael Hanselmann

query: Report data type for unary operators

All data kinds (used to restrict the data collected) referenced in a
filter can be requested once it's been “compiled”. However, the kinds
of fields used in boolean expressions (e.g. ["?", "xyz"]) were not
recorded. This patch changes the code accordingly and provides a unit...

1ca7b773 10/11/2012 12:11 pm Michael Hanselmann

Add basic unit tests for "gnt-cluster epo"

This patch adds some unit tests for “gnt-cluster epo”. Not everything is
covered, but at least the bug fixed in the previous patch is.

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

4fdedd09 10/08/2012 02:39 pm Michael Hanselmann

jstore: Nicer error message on non-numeric file content

An error like “invalid literal for int() with base 10” can be quite
confusing.

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

46118ed2 10/08/2012 02:09 pm Iustin Pop

Merge ganeti-master-cleaner back into ganeti-cleaner

As I wrote during/after the review on commit 2958c56, “ganeti-cleaner:
Separate queue cleaning code”, while I appreciated the permission
separation, I didn't like too much the file-based approach:

- it is a very simple script, and lots of the code is duplicated...

43a8f36a 10/05/2012 07:23 pm Bernardo Dal Seno

Explicitly ask for the default iallocator in commands

Now "gnt-instance recreate-disks" uses the default iallocator when "." is
specified as the iallocator. For uniformity, the same behavior applies to
these commands:
gnt-node evacuate
gnt-instance migrate...

fbdac0d9 10/05/2012 07:22 pm Michael Hanselmann

bdev: Add functions to verify file storage paths

- LoadAllowedFileStoragePaths: Loads a list of allowed file storage
paths from a file
- CheckFileStoragePath: Checks a path against the list of allowed paths

The unit test for “utils.IsBelowDir” is updated with cases which weren't...

6a9b9778 10/05/2012 04:52 am Michael Hanselmann

utils.FilterEmptyLinesAndComments: Return list

We don't use generators often and lists are easier to re-use.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

555b6cb1 10/05/2012 04:50 am Michael Hanselmann

Improve disk wipe unit test

- Don't hardcode node name in some places
- Don't define functions inside functions
- Simplify code for testing with and without offset, this is now in two
separate tests

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

fa8ef9d6 10/05/2012 04:50 am Michael Hanselmann

Wipe added space when growing disks

This patch adds code to wipe newly added disk space when growing disks
using “gnt-instance grow-disk”. “New disk space” is defined as the delta
between the old block device size (not necessarily equal to the amount
recorded in the configuration) and the new recorded size. Extra caution...

129cce69 10/05/2012 04:50 am Michael Hanselmann

Add unit tests for cmdlib._WipeDisks

This is in preparation for adding disk wipe on growing disks.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

1be3e86c 10/04/2012 06:00 pm Michael Hanselmann

Add unit test for FilterEmptyLinesAndComments

I somehow forgot this in the previous patch.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>