| Branch: | Tag: | Revision:

root / test / @ 1a2eb2dc

History | View | Annotate | Download (6.7 kB)

# Date Author Comment
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 <>

0d20cc42 12/22/2011 03:12 pm Bernardo Dal Seno

unit tests: Add tests for uid and gid handling in utils.WriteFile

These tests need fakeroot. If it's not present, they are not run (they
don't fail).

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

c6a65efb 01/27/2011 03:15 pm Michael Hanselmann

Fix unittest breakage on Python 2.4/2.5

Commit 70b0d2a29 broke unittests on Python 2.4 and 2.5. Turns out that
Python 2.6 and above allow classes to be passed as custom test runners,
whereas earlier versions don't.

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

913138f4 09/16/2010 01:26 pm Michael Hanselmann

Always enable logging for unittests

By enabling all log levels, we ensure all calls are fully evaluated.
There was one case in the workerpool where a call to “logging.debug”
was wrong, but not caught in unittests because debug logging was

The optional environment variable “LOGTOSTDERR” can be set to...

a9b144cb 07/29/2010 04:48 pm Michael Hanselmann

Ensure assertions are evaluated in tests

A lot of assertions are used in Ganeti's code. Some unittests even check
whether AssertionError is raised in some cases. Explicitely ensuring
assertions are evaluated makes sure those tests don't fail and
assertions are checked....

43983a88 01/14/2010 02:17 pm Michael Hanselmann

testutils: Print name of test program before running it

While the name can be looked up in, this
is useful when an automated test just hangs and needs
to be killed.

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

25231ec5 11/03/2009 12:34 pm Michael Hanselmann

Ignore log messages in unittests

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

d357f531 10/19/2009 05:57 pm Michael Hanselmann

Fix serializer unittests

Commit d22b29997cd broke the serializer unittests with certain
versions of simplejson. This patch removes sort_keys again
and implements a slightly more efficient way of detecting
simplejson functionality. The serializer unittests no longer...

3f991867 09/03/2009 06:44 pm Michael Hanselmann

Add simple unittest for hooks documentation

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Luca Bigliardi <>

f848ac00 08/25/2009 06:39 pm Michael Hanselmann

Run unittests in a temporary directory

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

9b977740 02/12/2009 11:15 am Guido Trotter

Apply the right permissions to /etc/hosts

In the current Ganeti version when modifying /etc/hosts we mistakenly
give it the permissions of the temporary file we create to define its
content, which is by default 0600. This breaks most non-root
applications, and thus must be corrected. This patch forces the mode to...

51596eb2 01/20/2009 01:18 pm Iustin Pop

Unify some unittest functions

This patch adds unified temporary file handling to the
testutils.GanetiTestCase class, which adds easy creation and automated
cleanup of temporary files.

The patch allows a simpler handling in a couple of test cases but
requires all child classes to call the parent setUp and tearDown...

149a5439 10/20/2008 09:01 pm Iustin Pop

Generalize the reading of test file data

Currently we have two methods in of computing
the test data file name - and, of course, they don't give the same

The patch moves the functions to compute the test file name and reading...

c9c4f19e 02/26/2008 10:15 pm Michael Hanselmann

Split GanetiUnitTest into

Reviewed-by: iustinp