Statistics
| Branch: | Tag: | Revision:

root / test @ 72737a7f

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

6634816b 01/07/2008 06:34 pm Iustin Pop

Fix ‘make distcheck’ breakage introduced in r455

This patch fixes the ‘make distcheck’ breakage caused by missing test data in
the archive and missing handling of builddir!=srcdir case.

Reviewed-by: schreiberal

3840729d 01/07/2008 01:22 pm Iustin Pop

Add unittest for DRBD8 drdbsetup show parser

This patch changes the bdev.DRBD8._GetDevInfo to take a string instead
of a minor, separates the `drbdsetup show` invocation into a new
separate method (bdev.DRBD8._GetShowData) and modifies the rest of the
DRBD8 class to make the appropriate calls....

320b4e2d 12/03/2007 04:32 pm Alexander Schreiber

Fix the unittest for locking.

Reviewed-by: imsnah

7fbb1f65 11/20/2007 11:18 am Michael Hanselmann

Make sure aliases written to /etc/hosts are unique.

Reviewed-by: iustinp

f7414041 11/20/2007 11:17 am Michael Hanselmann

Add function to return list with unique elements.

Reviewed-by: ultrotter

f89f17a8 11/16/2007 02:43 pm Michael Hanselmann

Fix typo in function name.

Reviewed-by: schreiberal

ebe8ef17 11/14/2007 05:56 pm Michael Hanselmann

Use setUp/tearDown for tests using temporary files.

Reviewed-by: schreiberal

667479d5 11/14/2007 05:55 pm Michael Hanselmann

Wrap line longer than 80 characters.

Reviewed-by: ultrotter

f0990e0c 11/14/2007 05:55 pm Michael Hanselmann

Compare file contents directly in unittests.

Reviewed-by: schreiberal, ultrotter

9cd372ad 11/13/2007 05:39 pm Michael Hanselmann

Fix unittests broken by revision 360.

Reviewed-by: schreiberal

9440aeab 11/12/2007 07:09 pm Michael Hanselmann

Fix functions for /etc/hosts.

- Combine hostname and aliases on one line
- Fix bug with wrongfully removed newline characters
- Use wrapper for SetEtcHostsEntry in cmdlib

Reviewed-by: iustin

424908c1 11/12/2007 07:03 pm Michael Hanselmann

Rollback commit 356.

2d6cfa31 11/12/2007 06:44 pm Michael Hanselmann

Add functions for known_hosts files.

Reviewed-by: TODO

2395c322 11/09/2007 10:13 pm Iustin Pop

Soften the requirements for hooks execution

Currently, an unreachable node (or one that return undetermined failure)
in the hooks pre-phase will abort the curren operation. This is not
good, as a down node could prevent many operation on the cluster.

This patch changes a RPC-level failure (and not a hook execution...

899d2a81 11/09/2007 04:53 pm Michael Hanselmann

Add functions to modify /etc/hosts.

Reviewed-by: schreiberal

24818e8f 11/05/2007 02:14 pm Michael Hanselmann

Rename utils.GetUUID to utils.NewUUID.

Reviewed-by: schreiberal

fafa5990 10/17/2007 05:36 pm Alexander Schreiber

Fix unit tests for hooks.

Reviewed-by: imsnah

59072e7e 10/11/2007 03:04 pm Michael Hanselmann

Use the kernel's ability to generate UUIDs.

This removes the dependency on either the uuid module or e2fsprogs' uuidgen.

Reviewed-by: iustinp

16abfbc2 10/10/2007 08:20 pm Alexander Schreiber

Remove fping as a dependency for Ganeti.

This patch completely gets rid of fping
- replace all fping invocations with TcpPing calls
- update documentation accordingly.
- associated cleanups (use constant for localhost IP, use more sensible
defaults for TcpPing and use those)...

2f31098c 10/10/2007 01:00 pm Iustin Pop

Remove the shebang from modules

Since modules are not directly executables, remove the shebang from
them. This helps with lintian warnings.

Also make the autogenerated _autoconf.py contain two comment lines at
the beginning, like the other modules.

Reviewed-by: ultrotter

9ff7e35c 10/08/2007 01:03 pm Michael Hanselmann

Fix “make distcheck”.

- Move symlink to “ganeti” to top dir
- Add ganeti.config_unittest.py to tests to be run
- Make sure everything is built before tests are run

Reviewed-by: iustinp

eedbda4b 10/08/2007 11:59 am Michael Hanselmann

Add function to list files in a directory, excluding those beginning with a
dot.

Reviewed-by: iustinp

6f1bebf9 10/01/2007 05:31 pm Michael Hanselmann

Import utils into unittest.

Reviewed-by: schreiberal

89e1fc26 09/21/2007 04:37 pm Iustin Pop

Remove requirement that host names are FQDN

We currently require that hostnames are FQDN not short names
(node1.example.com instead of node1). We can allow short names as long
as:
- we always resolve the names as returned by socket.gethostname()
- we rely on having a working resolver...

4ca1b175 09/17/2007 05:04 pm Alexander Schreiber

Cleanup up selective imports for utils and utils unit test.

Reviewed-by: iustinp, imsnah

2c30e9d7 09/17/2007 02:18 pm Alexander Schreiber

Added TcpPing to do ping-alike via TCP connect(2) with defined source address.
To be used to replace the currently fping(8) based reachability test.

Reviewed-by: imsnah

5ca84bdd 09/12/2007 06:54 pm Michael Hanselmann

Fix typo in last commit.