1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

7 Commits

Author SHA1 Message Date
Rusty Russell
7525493264 libctdb: test: run.sh script
This is a script which starts up a fake ctdbd and runs the libctdb
test suite.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit 67ca040b07713d83385db63489c887f7156b7853)
2010-06-21 16:09:16 +09:30
Rusty Russell
505e481588 libctdb: test: add readrecordlock support
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit 1a23581c70a0c8c3b9c8fd4651ce1b2bb4464f97)
2010-06-21 16:06:00 +09:30
Rusty Russell
0be60b6a7a libctdb: test: add database save and restore
Once we do operations which alter the TDBs, we need to restore them to
pristine state after a failed child dies.

The method used here is a terrible hack: it should at least do a
tdb_lockall() on the database before blatting it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit d48ec16bd2b4932442d95fc43bea52baa0425501)
2010-06-21 15:00:46 +09:30
Rusty Russell
d2def0ee1f libctdb: test: --no-failtest
Sometimes you just want to test that the basic test case is sane,
without all the failure paths being tested.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit be7c0bffb0d924c3e72753045d5b85ce90407579)
2010-06-21 14:48:54 +09:30
Rusty Russell
b0a8fd19ff libctdb: test: improve logging of failure paths
We include the file and line which called the functions, so the printed
failure path now looks like:

	[malloc(ctdb.c:144)]:1:S[socket(ctdb.c:168)]:1:S...

The form is:
    [ <function> ( <caller> ) ] : <input line> : <result>

<function> is the function which is called (eg. malloc).
<caller> is the file and line number which called <function>.
<input line> is the 1-based line number in the input which we were up to.
<result> is 'S' (success) or 'F' (failure).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit 5fb6da30b5b5a8b761c8ab9a8124b87b759ef055)
2010-06-21 14:57:11 +09:30
Rusty Russell
fee11bf13b libctdb: test: logging enhancement
Make children log through a pipe to the parent, which then spits it out
only if the child has a problem.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit 8ac006cf6c6cbfd3fe1606178eb0f0127d33f632)
2010-06-21 15:02:05 +09:30
Rusty Russell
4c0f3dcffe libctdb: test infrastructure
This introduces 'ctdb-test', a program for testing libctdb.  It takes
commands on standard input (with reduced functionality) or an input file.

It still needs some cleaning up, but you can uncover a bug in libctdb
today simply by running a simple attachdb test:

	$ ctdb-test tests/attachdb1.txt

It will print out a crash, and the path of successful and failed
operations which lead to it:

	...
	Child signalled 11 on failure path: [malloc]:1:S[socket]:1:S[connect]:1:S[malloc]:1:S[malloc]:1:S[malloc]:1:S[malloc]:4:S[malloc]:4:F

Feed that failure path into ctdb-test using --failpath (under a debugger):

	gdb --args ctdb-test tests/attachdb1.txt --failpath=[malloc]:1:S[socket]:1:S[connect]:1:S[malloc]:1:S[malloc]:1:S[malloc]:1:S[malloc]:4:S[malloc]:4:F

And you hit the exact error.

It is based on the fork-to-fail model of nfsim.  The relevant parts are
from page 154 of the proceedings of 2005 Ottawa Linux Symposium Volume II:
	http://www.linuxsymposium.org/2005/linuxsymposium_procv2.pdf

Or our presentation of same (from slide 21):
	http://ozlabs.org/~jk/projects/nfsim/nfsim.sxi

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit b4aab4199a57898877b6545a54f212087ed4b35a)
2010-07-16 14:12:40 +09:30