Statistics
| Branch: | Tag: | Revision:

root / test @ a5728081

# Date Author Comment
a5728081 02/10/2009 05:06 pm Guido Trotter

Instance parameters: force typing

We want all the hv/be parameters to have a known type, rather than a
random mix of empty string, boolean values, and None, so we declare the
type of each variable and we enforce/convert it.

- Add some new constants for enforceable value types...

7b80424f 02/03/2009 05:42 pm Iustin Pop

Fix unittest encoding breakage

Due to the fact that we sanitize now the output from environment
scripts, the unittest needs to be adjusted. My bad for not checking it.

Reviewed-by: imsnah

4e5a68f8 01/29/2009 05:03 pm Oleksiy Mishchenko

RAPI: rlib1 removal

The resources we still need moved to rlib2.

Reviewed-by: iustinp

fc72a3a3 01/29/2009 05:02 pm Oleksiy Mishchenko

RAPI: Implement /2 resource

Reviewed-by: iustinp

dc824c9f 01/29/2009 04:52 pm Oleksiy Mishchenko

RAPI: Deprecate version Rapi version1

It is impossible to keep backward compatibility due to
significant changes in the Ganeti core.

Reviewed-by: iustinp

4a89c54a 01/23/2009 02:36 pm Iustin Pop

Introduce more configuration consistency checks

This patch enhances the duplicate DRBD minors checks (currently just a
few) and adds automatic checks of configuration consistency at
configuration file writing time.

In order to do so and show meaningful error messages, the...

767d52d3 01/20/2009 01:18 pm Iustin Pop

DRBD: check for in-use minor during Create

In order to prevent errors with old, in-use DRBD minors, we check and
abort at create time if our minor is already in use. For this we need to
also modify DRBD8Status to be able to parse cs:Unconfigured devices....

f65f63ef 01/20/2009 01:18 pm Iustin Pop

Add a TailFile function

This patch adds a tail file function, to be used for parsing and returning in
the job log OS installation failures.

Reviewed-by: ultrotter

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

68fa9caf 12/19/2008 02:57 pm Michael Hanselmann

ganeti.http: Add support for private data in HTTP requests

Reviewed-by: amishchenko

6e797216 12/18/2008 06:23 pm Michael Hanselmann

Add rename function automatically creating directories if needed

Unfortunately, os.makedirs in Python 2.4 is not safe against multiple
processes creating the same directory tree at the same time. This is
only fixed in Python 2.5 and up. Adding more checks in our code doesn't...

f30ca1e6 12/17/2008 04:30 pm Michael Hanselmann

Add simple unittests for ganeti.http

More complex unittests will need some refactoring in the HTTP code.

Reviewed-by: amishchenko

84f2756e 12/04/2008 05:23 pm Michael Hanselmann

Rename all HTTP classes to camel case

It should be consistent.

Reviewed-by: amishchenko

e820685c 12/03/2008 06:08 pm Michael Hanselmann

ganeti.http: Remove ApacheLogfile class

We don't need it anymore and it wouldn't work as it is, anyway.

Reviewed-by: ultrotter

7ccb3074 12/02/2008 04:49 pm Guido Trotter

Fix hooks_unittest with new rpc call structure

Reviewed-by: iustinp

028c6b76 11/28/2008 03:58 pm Oleksiy Mishchenko

RAPI:Fix root list and unittest for it.

Reviewed-by: imsnah

9fbfbb7b 11/23/2008 05:34 pm Iustin Pop

Enable auto-unit formatting in script output

This patch enables by default the old 'human-readable' option, but in a
slightly different model.

The option is now called "units" and takes either:
- 'h' for automatic formatting
- 'm', 'g' or 't' for mebi/gibi/tebibytes...

a2d2e1a7 11/21/2008 05:35 pm Iustin Pop

Move FieldSet class to utils.py

Since we can use the FieldSet class in cli.py to nicely format disk
sizes and such, we move it to utils.py and also move its associated
unittest. I didn't remove the cmdlib.py unittest file as that's not the
good direction :)...

a143be68 11/18/2008 01:30 pm Iustin Pop

Skip another testWaitingXblocksY

The waiting sharer blocks exclusive is another not-possible to test
right now.

Sorry for missing it the first time; there are no other testWaiting...
tests.

Reviewed-by: ultrotter

6de7c41d 11/18/2008 12:00 pm Iustin Pop

Add a FieldSet class for variable parameter sets

This patch adds a _FieldSet class that can be used for the new variable
parameter sets: e.g. the sda_size will change to disk/0.size (or
similar) and we need to both check validity and extract the index of the...

e6416152 11/18/2008 11:58 am Iustin Pop

Skip the waitingExclusiveBlockSharer test

Until we have a way to properly test this, we'll skip the test.

Reviewed-by: imsnah

4607c978 11/12/2008 08:25 am Iustin Pop

Convert the locking unittests to repetition-test

Currently the locking tests are using timeouts to ensure an event will
'never happen'. However, this is suboptimal.

The patch converts all of these to instead: not wait, but sequence the
operations logically and expect that they execute as such. In case of...

44bf25ff 11/11/2008 12:58 pm Iustin Pop

Remove zombie special case from IsProcessAlive

Based on the discussion on the mailing list, we remove the special
casing of zombie processes.

Note we don't use kill -0 since that has a different meaning than "check
process is alive", so this function is still linux-specific....

ff5251bc 11/11/2008 12:58 pm Iustin Pop

Add cleanup of processes to utils.KillProcess

In case the process we want to signal is our own process, and the signal
we send is a deadly one, we should also cleanup after the process.

This patch adds a new parameter waitpid to this function that does this,...

8797df43 11/11/2008 05:12 am Iustin Pop

Implement working directory for utils.RunCmd

In order to replace usage of the shell just for 'cd %s; ...' we need to
be able to specify the working directory for childs.

The patch also changes the default working directory (when not
specified) to "/", as opposed to the current dir; since the daemos run...

36117c2b 10/24/2008 05:43 pm Iustin Pop

Modify utils.RunCmd to write output to file

Currently we launch processes via the shell in a few places only to
redirect standard output and error to a log file ("&> $file"). It is
better to do such redirection from within RunCmd itself.

This patch splits RunCmd in two parts, the setup and the execution part,...

86d9d3bb 10/21/2008 08:54 pm Iustin Pop

Move some LU logging to use proc.Log*

We change some messages which are obviously intended for the user to use
the proc.Log* functions instead of (only) the logging ones.

We also fix some wrong uses of feedback_fn.

Reviewed-by: imsnah

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

Generalize the reading of test file data

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

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

02691904 10/20/2008 07:38 pm Alexander Schreiber

Set default hypervisor at cluster init

During cluster init, set the default hypervisor to be used for instances.
Ensure that the default hypervisor belongs to the set enabled hypervisors
for this cluster. Also fix a small bug with setting the default enabled...

46fbdd04 10/20/2008 03:33 pm Iustin Pop

Convert cli.py to logging

We also add two function for printing messages, so that scripts won't
have to import logger to get these. They are a simple extension over the
logger ones, as they accept the call style from logging:
ToStdout("Message: %s", msg)...

fa10bdc5 10/20/2008 02:04 pm Michael Hanselmann

Remove old HTTP server code

All users of this code have been migrated to the new and shiny HttpServer
class.

It also fixes a typo in the ApacheLogfile unittests. It has not yet been
decided whether we should keep ApacheLogfile or not, hence leaving it in....

5d8d232c 10/17/2008 12:47 pm Michael Hanselmann

Fix remote API unittest

I broke it with rev 1864. This patch also removes whitespace at
line endings.

Reviewed-by: amishchenko

09352fa4 10/16/2008 04:05 pm Iustin Pop

Really fix with the zombie test (hopefully)

So, instead of any timeouts for synchronization, we move to actual
events. We still have one (huge) timeout for pathological cases (just to
cleanup), but we don't sleep at all in normal usage.

The patch moves the zombie/cleaned up child creation out from setUp(),...

fcd62d84 10/14/2008 09:38 am Iustin Pop

Implement parameter removal in SplitKeyVal

This patch adds paramter removal in SplitKeyVal, by prefixing a
value-less key with "-"; this is needed in resetting parameters back to
cluster defaults, but care must be applied now that None can come from
the parser....

a8469393 10/13/2008 03:17 pm Iustin Pop

Add two new options types for CLI usage

For the new 2.0-style command line options, we need to parse strings of
the type:
ident:key=val[,...]
and
key=val[,...]

This patch adds two new option builders for these two, which return
(ident, {key=val,}) and {key=val,} for the above two formats. It also...

caad16e2 10/12/2008 11:40 pm Iustin Pop

Abstract checking own address into a function

Currently, we check if we have a given ip address (i.e. it's alive on
one of our interfaces) but manually calling TcpPing(source=localhost).
This works, but having it spread all over the code makes it hard to...

72737a7f 10/10/2008 12:55 pm Iustin Pop

Convert rpc module to RpcRunner

This big patch changes the call model used in internode-rpc from
standalong function calls in the rpc module to via a RpcRunner class,
that holds all the methods. This can be used in the future to enable
smarter processing in the RPC layer itself (some quick examples are not...

c666722f 10/08/2008 09:48 pm Oleksiy Mishchenko

Ajust config unittest.

Reviewed-by: iustinp

2241e2b9 10/06/2008 06:59 pm Iustin Pop

Add a simple timespec parsing function

This function will be used for auto-archiving jobs via the command line.
The function is pretty simple, we only support up to weeks since months
and higher are not 'precise' entities, and dealing with them would
require us to start using calendar functions....

c259ce64 10/01/2008 08:37 pm Michael Hanselmann

Get rid of ssconf

Remove leftovers from ssconf.

Reviewed-by: iustinp

7688d0d3 10/01/2008 08:35 pm Michael Hanselmann

Convert ssh.py

Get rid of ssconf and convert to configuration instead.

Reviewed-by: iustinp

437138c9 10/01/2008 08:34 pm Michael Hanselmann

Convert mcpu.py

Replacing ssconf with configuration.

Reviewed-by: iustinp

36b8c2c1 10/01/2008 12:24 pm Michael Hanselmann

Fix unittests broken by revision 1727

Reviewed-by: iustinp

f6bd6e98 10/01/2008 12:03 pm Michael Hanselmann

Add cluster options from ssconf to configuration

ssconf will become write-only from ganeti-masterd's point of view,
therefore all settings in there need to go into the main configuration
file.

Reviewed-by: iustinp

b9eeeb02 10/01/2008 12:03 pm Michael Hanselmann

Move instantiation of config into bootstrap.py

Future patches will add even more variables to the cluster config.
Adding more parameters wouldn't make the function easier to use and
it doesn't make sense to pass them to another function, as it's
only done once in bootstrap.py on cluster initialization....

d2aff862 09/11/2008 12:44 pm Guido Trotter

LockSet: forbid add() on a partially owned set

This patch bans add() on a half-acquired set. This behavior was
previously possible, but created a deadlock if someone tried to acquire
the set-lock in the meantime, and thus is now forbidden. The
testAddRemove unit test is fixed for this new behavior, and includes a...

d4803c24 09/11/2008 12:43 pm Guido Trotter

Fix LockSet._names() to work with the set-lock

If the set-lock is acquired, currently, the _names function will fail on
a double acquire of a non-recursive lock. This patch fixes the behavior,
and some lines of code added to the testAcquireSetLock test check that...

45bc5e4a 09/05/2008 01:57 pm Michael Hanselmann

utils.SplitTime: More rounding fixes

SplitTime didn't round the same on different platforms. This patch changes
it to use microseconds and not care about rounding.

Reviewed-by: iustinp

b77ba978 08/29/2008 06:04 pm Michael Hanselmann

utils.SplitTime: Fix rounding of milliseconds

Reported by Iustin.

It used to return this:

utils.SplitTime(1234.999999999999)

(1234, 1000)

while it should've returned this:

utils.SplitTime(1234.999999999999)

(1235, 0)

Reviewed-by: ultrotter

d4f6a91c 08/18/2008 03:51 pm Guido Trotter

A few more locking unit tests

A few more tests written while bug-hunting. One of them shows a real
issue, at last. :)

Reviewed-by: imsnah

90c942d1 08/18/2008 03:50 pm Guido Trotter

Add lock-all-through-GLM unit test

I was hunting for a bug in my code and thought the culprit was in the
locking library, so I added a test to check. Unfortunately turns out it
wasn't. :( Committing the test anyway, while still trying to figure out
what's wrong......

739be818 08/11/2008 07:26 pm Michael Hanselmann

Add functions to split time into tuple and merge it back

These will be used for job logs.

Reviewed-by: ultrotter

a87b4824 07/31/2008 05:33 pm Michael Hanselmann

Add FileLock utility class

This class is a wrapper around fcntl.flock and abstracts opening and
closing the lockfile. It'll used for the job queue.

(The patch also removes a duplicate import of tempfile into the unittest)

Reviewed-by: iustinp

441e7cfd 07/31/2008 12:06 pm Oleksiy Mishchenko

First write operation (add tag) for Ganeti RAPI

Add instance tag handling, improved error logging.
...oh, yes adopt instance listing for RAPI2!

Reviewed-by: iustinp

53beffbb 07/30/2008 11:34 am Iustin Pop

Expose utils.DaemonPidFileName

Since we need to compute this from outside utils.py, we change this to a
public function.

Reviewed-by: ultrotter

b2a1f511 07/29/2008 11:49 am Iustin Pop

Add a KillProcess function

We cannot depend on all environments to have a start-stop-daemon or
similar tool. We instead implement a KillProcess function that behaves
similar to “start-stop-daemon --retry”.

Note that the attached unittest can hang in foreground if the child...

d9f311d7 07/29/2008 11:49 am Iustin Pop

Change IsPidFileAlive into ReadPidFile

We already have a function to test if a PID is alive, so it makes more
sense to use function composition that force calling (since we need to
read PIDs from files in other places too). Now IsProcessAlive returns
False for PIDs <= 0, since this is the error return from ReadPidFile....

6760471c 07/28/2008 01:35 pm Michael Hanselmann

Fix unittests for ganeti-rapi

The RESTHTTPServer module went the way of the dodo.

Reviewed-by: iustinp

a0638838 07/24/2008 07:34 pm Oleksiy Mishchenko

Switch RAPI to ganeti.http module

Reviewed-by: imsnah

af99afa6 07/24/2008 11:46 am Guido Trotter

Add utils unittests for new functions

The submitted WritePidFile, RemovePidfile and IsPidFileAlive functions
miss unit tests. Adding a simple one which covers their basic
functionality.

Reviewed-by: iustinp

04e1bfaf 07/23/2008 05:23 pm Guido Trotter

Invert nodes/instances locking order

An implementation mistake from the original design caused nodes to be
locked before instances, rather than after. This patch inverts the level
numbering, changing also the relevant unittests and the recursive
locking function starting point....

10b207d4 07/22/2008 04:33 pm Oleksiy Mishchenko

Split RAPI resources to pieces

Reviewed-by: iustinp

4cbd4462 07/11/2008 04:48 pm Oleksiy Mishchenko

Copy the rest of the Restful-API files to trunk

Reviewed-by: imsnah

e5392d79 07/09/2008 03:35 pm Iustin Pop

Fix utils.py unittest

Reviewed-by: imsnah

d4fa5c23 07/09/2008 01:41 pm Iustin Pop

Remove the old locking functions

This removes (hopefully) all traces of the old locking functions and
uses.

Reviewed-by: imsnah

b10b9d74 07/08/2008 07:32 pm Guido Trotter

Add a more comment lines to testLockingConstants

This is to discourage even more whoever may think that this requirement
is not really useful and can be lifted, and to at least know where it's
used before trying to break it.

Reviewed-by: imsnah

2e1d6d96 07/08/2008 07:31 pm Guido Trotter

Add a new LockSet unittest

This test checks the LockSet behaviour when an empty list is passed.
The current behaviour is expected, but since this is a corner case,
we're safer to keep it under a check, and if we need a different one
monitor that everything is as we expect it to be....

77b657a3 07/08/2008 11:49 am Guido Trotter

Pass context to LUs

Rather than passing a ConfigWriter to the LUs we'll pass the whole
context, from which a ConfigWriter can be extracted, but we can also
access the GanetiLockManager. This also fixes the places where a FakeLU
is created.

Reviewed-by: iustinp

f4555db2 07/08/2008 11:49 am Guido Trotter

mocks: create a FakeContext object

This will be passed to FakeLUs

Reviewed-by: iustinp

08a6c581 07/08/2008 11:41 am Guido Trotter

Locking: remove LEVEL_CONFIG lockset

Since the ConfigWriter now handles its own locking it's not necessary to
have a specific level for the config in the Locking Manager anymore.
This patch thus removes it, and all the unittest calls that used it, or
depended on it being present....

42a999d1 07/08/2008 11:40 am Guido Trotter

Locking: add ssynchronized decorator

This patch creates a new decorator function ssynchronized in the locking
library, which takes as input a SharedLock, and synchronizes access to
the decorated functions using it. The usual SharedLock semantics apply,
so it's possible to call more than one synchronized function at the same...

76094e37 07/04/2008 06:34 pm Michael Hanselmann

Add generic worker pool implementation

Reviewed-by: ultrotter

7b4126b7 07/01/2008 02:44 pm Iustin Pop

Add a FirstFree function to utils.py

This function will return the first unused integer based on a list of
used integers (e.g. [0, 1, 3] will return 2).

Reviewed-by: imsnah

d2525573 06/30/2008 07:11 pm Guido Trotter

Remove duplicate code in hooks unittests

All the tests there used to creare a cfg, a sstore, an opcode and a LU.
Put all the duplicate code in the setUp function.

Reviewed-by: iustinp

501c95a2 06/23/2008 08:22 pm Michael Hanselmann

Add unittests for ganeti.serializer

Reviewed-by: iustinp

740c5aab 06/23/2008 03:50 pm Guido Trotter

Fix the zombie process unittest

The failure is because in high load, the parent gets to run before the
child has the chance to os._exit(), and therefore it is still running
when the parent does the check.

The fix removes the chance of this happening by waiting to receive a SIGCHLD...

1b45f4e5 06/23/2008 02:11 pm Michael Hanselmann

Add functions to calculate version number to constants.py

In cfgupgrade, we need to extract parts of and build new version numbers.

Reviewed-by: iustinp

e8230860 06/19/2008 03:56 pm Michael Hanselmann

Use a single Makefile.am instead of many

This change allows us to use cleaner dependencies between
directories. The build system is basically rewritten in large parts
and may contain bugs.

Reviewed-by: iustinp

ae9da390 06/18/2008 06:09 pm Iustin Pop

Fix bdev unittest when run under distcheck

The path to the filename for drbd8 proc data is not correctly computed
when using distcheck. The patch duplicates it from the other drbd tests.

Reviewed-by: ultrotter

6b90c22e 06/18/2008 06:08 pm Iustin Pop

Rework the DRBD8 device status computation

Currently, compute the status of a drbd8 device in GetSyncStatus and
return only the values that we need (and fit in the framework of
GetSyncStatus). However, the full status details are useful (and needed)
in other places, so the patch attempts to improve this situation....

eeb1d86a 05/07/2008 02:12 pm Michael Hanselmann

Add unittest for constants

Reviewed-by: iustinp

dcf315e2 05/01/2008 02:15 pm Guido Trotter

locking: remove obsolete comment

Reviewed-by: iustinp

01fd6005 04/28/2008 01:42 pm Manuel Franceschini

Make testSignal unittest not depend on default shell

This patch changes the code executed when testing the signal handling
of RunCmd. Since sh does not always point to bash (e.g. on Ubuntu,
where it points to /bin/dash) this test might fail due to the returned...

75a5f456 03/18/2008 03:02 pm Michael Hanselmann

Add function to write cluster SSH key to known_hosts file

The whole Ganeti cluster has a single SSH key. Its fingerprint is
written to Ganeti's known_hosts file, together with an alias. This
allows us to always use that alias instead of the real hostname,...

b15d625f 03/11/2008 09:44 am Iustin Pop

Modify utils.TcpPing to make source address optional

This patch modifies TcpPing and its callers to make the source address
selection optional. Usually, the kernel will know better what
source address to use, just in some cases we want to enforce a given...

b2dabfd6 03/04/2008 07:12 pm Guido Trotter

LockSet: handle empty case

A LockSet is mostly useful when it has some locks in it. On the other hand
there are cases in which it must function even when empty. For example if a
cluster has no instances in it there's no reason why locking all of them
shouldn't work anyway. This patch adds test code for that situation and...

b5c0e9d9 03/04/2008 07:12 pm Guido Trotter

LockSet: add missing check code

This check that no operation had been performed before release() was missing in
the test code. Adding it.

Reviewed-by: imsnah

cdb08f44 03/04/2008 04:46 pm Michael Hanselmann

Codestyle updates for locking code

Reviewed-by: ultrotter

3b7ed473 03/04/2008 03:18 pm Guido Trotter

LockSet: make acquire() able to get the whole set

This new functionality makes it possible to acquire a whole set, by passing
"None" to the acquire() function as the list of elements. This will avoid new
additions to the set, and then acquire all the current elements. The list of...

3f404fc5 03/04/2008 03:17 pm Guido Trotter

LockSet: improve remove() api

Lockset's remove() function used to return a list of locks we failed to remove.
Rather than doing this we'll return a list of removed locks, so it's more
similar to how acquire() behaves. This patch also fixes the relevant unit tests....

0cc00929 03/04/2008 03:17 pm Guido Trotter

LockSet: make acquire() return the set of names

In a LockSet acquire() returned True on success. This code changes that to
return a set containing the names of the elements acquired. This is still a
true value if we acquired any lock but is slightly more useful (because if...

7ee7c0c7 03/04/2008 12:09 pm Guido Trotter

Initial GanetiLockManager implementation

Includes some locking-related constants and explanations on how the
LockManager should be used, the class itself and its test cases.

The class includes:
- a basic constructor
- functions to acquire and release lists of locks at the same level...

aaae9bc0 02/28/2008 05:06 pm Guido Trotter

LockSet implementation and unit tests

A LockSet represents locking for a set of resources of the same type. A thread
can acquire multiple resources at the same time, and release some or all of
them, but cannot acquire more resources incrementally at different times...

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

Split GanetiUnitTest into testutils.py

Reviewed-by: iustinp

84152b96 02/21/2008 03:45 pm Guido Trotter

Add a few SharedLock delete() tests

- Check that even a shared acquire() fails on a deleted lock
- Check that delete() fails on a lock you share (must own it or nothing)

These are assumptions I build on in future code, so better check for them.
Currently no code change is necessary for them to be valid....

4354ab03 02/20/2008 03:47 pm Guido Trotter

SharedLock: fix a wrong unit-test helper code

The _doItDelete helper code was supposed to be used to dispatch threads that
deleted the SharedLock. It actually just acquired it exclusively. This remained
unnoticed as the helper thread is just used to test interaction, not the delete...

a95fd5d7 02/19/2008 03:50 pm Guido Trotter

Add the delete() operation to SharedLock

This new operation lets a lock be cleanly deleted. The lock will be exclusively
held before deletion, and after it pending and future acquires will raise an
exception. Other SharedLock operations are modify to deal with delete() and to...

d6646186 02/18/2008 06:58 pm Guido Trotter

Fix a couple of SharedLock docstrings

Use the actual class name rather than a spaced version of it.

Reviewed-by: iustinp

162c1c1f 02/08/2008 01:23 pm Guido Trotter

Shared Lock implementation and unit tests.

Adding a locking.py file for the ganeti locking library. Its first component is
the implementation of a non-recursive blocking shared lock complete with a
testing library.

Reviewed-by: imsnah, iustinp

b6f2e47f 01/18/2008 06:07 pm Iustin Pop

Fix the make dist rule

In revision 459 I added a bug in the make dist rule in the sense that
the archive will include all of test/data directory, including the
.svn directory if it exists.

This patch fixes that problem and adds a distcheck hook that tests for...