1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

301 Commits

Author SHA1 Message Date
Ronnie Sahlberg
0d46488f6e Merge commit 'rusty/libctdb2'
(This used to be ctdb commit d41b802250ddc0a89581eb6285edfd66bdc7a78a)
2010-05-25 12:48:49 +10:00
Rusty Russell
d5f6026a22 libctdb: reorganize headers: remove ctdb.h, add ctdb_client.h and ctdb_protocol.h
ctdb_client.h is the existing internal client interface (which was mainly
in ctdb.h), and ctdb_protocol.h is the information needed for the wire
protocol only.

ctdb.h will be the new, shiny, libctdb API.

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

(This used to be ctdb commit 4bba6b8cd47b352f98d41f9f06258d5ac3c9adef)
2010-05-20 15:18:30 +09:30
Michael Adam
e0666edf6b tests:ctdb_bench: make send_start_messages() static - eliminates compile warning
Michael

(This used to be ctdb commit e1a16c23d7dbf011ad220572f1bf081331efa8f8)
2010-05-11 11:29:45 +02:00
Michael Adam
fd5a55cd22 tests: eliminate a floating point exception by requiring -n option to ctdb_bench
Michael

(This used to be ctdb commit 07823e1fe75c588b75f4e42c80b0a7bc974238f7)
2010-05-11 11:29:45 +02:00
Stefan Metzmacher
3419e9c4dd server: add "setup" event
This is needed because the "init" event can't use 'ctdb' commands.

metze

(This used to be ctdb commit 1493436b6b24eb05a23b7a339071ad85f70de8f4)
2010-02-23 10:38:49 +01:00
Martin Schwenke
a8508e8a96 Test suite: Make "ctdb ip" test backward compatible with older ctdb versions.
Recent updates to the test meant that it only worked with the latest
ctdb versions.  This changes things so that we never bother matching
the machine readable header, just the actual data in the output.  It
also takes a slightly more liberal approach in massaging the human
readable output to ensure it matches the machine readable output.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 11e72356e849ed4cb315c942e30e9bcadc624f42)
2010-02-11 10:08:46 +11:00
Stefan Metzmacher
179c098e86 server: start with disabled interfaces and let the event scripts enable the interfaces explicit
This makes sure that we don't get public addresses assigned during the
initial recovery and remove them again in the startup event.

metze

(This used to be ctdb commit f872e8c63a2f8979e6a0d088630575bdd4d7b4f1)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
a6437bc707 tools/ctdb: display interfaces in "ctdb ip" and "ctdb ip -Y" outputs
metze

(This used to be ctdb commit dffa2b05acce8b73c2fdd085311732bf57f01b7f)
2010-01-20 11:11:00 +01:00
Stefan Metzmacher
0054f0c54f tests: add a all_ips_on_node() helper function that wraps ctdb ip -Y
metze

(This used to be ctdb commit c24fbea156dfdc9154e94eace725526e44cbcdac)
2010-01-20 11:11:00 +01:00
Stefan Metzmacher
04d896a5fe tests/simple/11_ctdb_ip.sh: be more strict in checking ctdb ip -Y output
metze

(This used to be ctdb commit 27bde04966e22975777b4034dbaccfe158369110)
2010-01-20 11:11:00 +01:00
Stefan Metzmacher
fd06167caa server: add "init" event
This is needed because the "startup" event runs after the initial recovery,
but we need to do some actions before the initial recovery.

metze

(This used to be ctdb commit e953808449c102258abb6cba6f4abf486dda3b82)
2010-01-20 09:44:36 +01:00
Martin Schwenke
05dff92925 Merge commit 'origin/master'
(This used to be ctdb commit 82e1c5231c389bea935328a08ecf9b0b3a3979ef)
2009-12-18 14:44:25 +11:00
Martin Schwenke
d67f43fd50 Test suite: Add an optimisation in the getvar test.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d9105ea79df198a20c2bfe471c4793d1dbba886e)
2009-12-18 14:43:45 +11:00
Martin Schwenke
5e92afeb33 Test suite: allow settign of timeout triggers for all events not just monitor.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f319bd54369a2bc7d32c3bda7fc22f2ef1a51c3a)
2009-12-18 14:42:58 +11:00
Stefan Metzmacher
9a96ae0c97 server: only do the mkdir() calls for db_directory* once at the start
metze

(This used to be ctdb commit f30f33685db50860b6cd6fd1b6bdc3066620a78f)
2009-12-16 08:03:56 +01:00
Ronnie Sahlberg
fcd16342f6 Merge branch 'trans3'
(This used to be ctdb commit b765e12a5fb87a6121e49b349017b6a961929346)
2009-12-15 21:00:22 +11:00
Ronnie Sahlberg
3b53c02e34 add a new test tool that just locks and releases the same record over and over
(This used to be ctdb commit 24767be2eb9aed29704c2a4097bab5466cb6728f)
2009-12-15 12:14:49 +11:00
Ronnie Sahlberg
244bc5cc8f ctdb_fetch requires the number of nodes being specified.
Have it log an error and terminate if thie parameter was omitted

(This used to be ctdb commit 340be0179f55acfff77f8c3c8be958679227bde1)
2009-12-15 11:29:16 +11:00
Michael Adam
aea324336c tests: temporarily disable the transaction test tool.
Make it return success for make test.
This is temporarily disabled until the rewrite of the
transaction code (in samba and the daemon) using the global
lock feature has been ported to the ctdb client code.

Michael

(This used to be ctdb commit 78ca29352aa39f4ef4e41096b92d55cb2e0d348a)
2009-12-12 00:45:39 +01:00
Michael Adam
54b9a49e2e tests: remove the no_trans mode from ctdb_transaction.
Writes without transaction are not possible any more on
persistent databases.

Michael

(This used to be ctdb commit 59f46d7261dfdbdef900bf95dd9eb28ad22a46b2)
2009-12-09 22:04:48 +01:00
Michael Adam
332017925f tests: remove the persistent_unsafe writes test.
This is useless now that persistent write operations without
transaction are forbidden.

Michael

(This used to be ctdb commit b022863d44026c19d5aae54aa485b670bea0540e)
2009-12-09 21:57:00 +01:00
Michael Adam
aa6e42a4ba tests: remove persistent_safe write test.
This is useless now that persistent writes without transactions are forbidden.

Michael

(This used to be ctdb commit 9ac82311d796e1fab31f8de62b8ccc754445093c)
2009-12-09 21:56:59 +01:00
Michael Adam
c32ff2bbb0 test: add test 54_ctdb_transaction_recovery.sh
This is like the 53_ctdb_transaction test, but it additionally
runs a loop with recoveries while the transactions are running.

When called like this, the transaction loops run for 10 minutes:

CTDB_TEST_TIMELIMIT=600 tests/scripts/run_tests tests/simple/54_ctdb_transaction_recovery.sh

The default timelimit is 30 seconds.

Michael

(This used to be ctdb commit 2ff2679e8f3d50ebf735f2c420898a84268bdc95)
2009-12-09 21:56:59 +01:00
Michael Adam
edfc6a8c12 test: get value for --timelimit from environment var CTDB_TEST_TIMELIMIT in transaction test
Michael

(This used to be ctdb commit c13077ca64f6e6569c30ef7fcb044e5711dce1a3)
2009-12-09 21:56:59 +01:00
Michael Adam
814e3c501f tests:ctdb_transaction: print an extra counters when a commit fails
Michael

(This used to be ctdb commit 4113385865f53a57b18ea752a7dad8a08bed588e)
2009-12-04 11:30:21 +01:00
Michael Adam
0213cb4d0b tests: turn printfs into DEBUG statements in the ctdb_transaction test
Michael

(This used to be ctdb commit 0e130d79ab71cf3aa65c40af91866823246a0283)
2009-12-04 11:30:20 +01:00
Martin Schwenke
4ea6069de4 Test suite: Make the CIFS tickle test wait until it sees the required tickle.
The test depended on the exit code of "ctdb gettickles", which always
succeeds.  This change wraps the command in a function that checks
whether the tickle we're interested in is registered.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c4b05a731e1bee8f5b46529773a4f5389b2b6064)
2009-11-19 14:54:05 +11:00
Martin Schwenke
386d23757b Test suite: Fix the NFS and CIFS tickle tests.
The NFS test sleeps for MonitorInterval to give CTDB time to record an
NFS tickle.  However, this isn't always long enough.  This changes the
test to wait until a monitor event has actually occurred.

The CIFS test assumes that Samba is able to register a tickle with
CTDB before it notices that netstat has registered the tickle and can
use onnode to ask CTDB about it.  That is an incorrect assumption -
sometimes we can get to the point of asking CTDB about the tickle
before Samba and CTDB have processed it.  This adds a timeout loop
that makes the CIFS test wait until the tickle has been registered or
fail after 10 seconds.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 20a9d35933d89dc7eb710075f360686a49d78609)
2009-11-13 09:44:34 +11:00
Martin Schwenke
9dabb86f3f Merge commit 'origin/master'
(This used to be ctdb commit ffb911896704ddf6bd5a66e43ba2ae8c382e68de)
2009-11-11 12:16:30 +11:00
Michael Adam
de875c7eec Revert "dont exit on a commit failure"
This reverts commit 4e9a3a5dc232bac12ab387ea0cf4f1b279bed5c1.

Transaction commit should not be allowed to fail.
This is a real error.

Michael

(This used to be ctdb commit 825c506da76d7afd0714b75b8c8727874183a618)
2009-10-30 22:01:53 +11:00
Martin Schwenke
8767c894a0 Test suite: Regression fix - wait_until should not run command in sub-shell.
Commit 25e82a8a667a54c6921ef076c63fdd738dd75d19 changed wait_until()
to protect the command it runs from "set -e" by running it in a
subshell.  This breaks uses where the command is expected to set
global variables.  For example, wait_until_get_src_socket lost the
value of $out from its call to get_src_socket().

The fix is to not be lazy and use a sub-shell!

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 39642e745254d93d74dde907787503854fe6ca4a)
2009-10-28 13:02:18 +11:00
Martin Schwenke
12798118a1 Test suite: Remove the disable/enable monitor tests - they are useless.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 8264c42969d4be7fc6c5b4d56f8b5ef7c62b3bfb)
2009-10-21 21:47:06 +11:00
Martin Schwenke
f2a9ba6976 Test suite: Fix the timeouts on the skip share check tests.
The timeout for waiting for state changes isn't very predictable.  It
is "about" MonitorInterval seconds...  but can be longer given the
duration of eventscript runs and other things.  So, we change the
timeout to MonitorInterval + EventScriptTimeout, hoping it never takes
that long.

Move the eventscript installation/removal from the old fake-tests into
a function in the functions file.  Implement supporting functions to
create/remove/check-for various files that it handles.  Also add a
function that uses all of this that waits for the next monitor event
(but only if all other monitor events pass).

The final check in the skip share check tests uses the above and waits
for a monitor event, and then checks that the node is still healthy.

Also enhance the wait_until function to handle a command starting with
'!' (as a separate word) to make it easy to wait for a file not to
exist.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 25e82a8a667a54c6921ef076c63fdd738dd75d19)
2009-10-21 21:36:39 +11:00
Martin Schwenke
7b1e9267f2 Test suite: A timeout of MonitorInterval seconds sometimes isn't enough.
Monitor events sometimes happen a little bit more than MonitorInterval
seconds apart.  This changes some timeouts to MonitorInterval + 1
seconds.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6ef4364b3349145b2fec23e0431cd6df6dcadd41)
2009-10-20 17:11:01 +11:00
Martin Schwenke
b84c2d3a6e Test suite: New tests for validating SKIP_SHARE_CHECK options.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f50d64a8ac91415ca297216d2103ff940076f02b)
2009-10-20 16:52:22 +11:00
Martin Schwenke
43780f5f57 Test suite: Update 99_ctdb_uninstall_eventscript.sh to use ctdb_init().
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 2b478b0f5f09dd06626592573f053706ac637edd)
2009-10-20 16:51:06 +11:00
Martin Schwenke
d79f7647e7 Test suite: Fix bug in node_has_status().
This function has been broken since it was updated to work with the
"stopped" state (probably commit
67c5bfb5f02c9d45a32d976021ede4fb2174dfe9).  Although ${var#:*:0}
removes the shortest matching prefix of $var, '*' can match substrings
that include ':' if '0' isn't where you expect.  So we were making
unexpected matches and incorrectly returning true for some cases.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 11137bc2d492a62a26ec9f9f62ff362e81643f66)
2009-10-20 16:45:29 +11:00
Martin Schwenke
469ee69363 Test suite: add -x option to ctdb_init() function.
This facilitates tracing of tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 1f906bd3476e7cebf217e35b5477d6a7bb615a0c)
2009-10-20 16:44:44 +11:00
Ronnie Sahlberg
2ab8f6a368 Merge commit 'martins/master'
(This used to be ctdb commit 9b206d96da3341836cc25aee5693f551f6f3a80e)
2009-10-01 15:46:01 +10:00
Martin Schwenke
3edf5532d5 Test suite: The ctdb ping test should allow time to go backwards.
Time can actually go backwards during this test if ntpd happens to
adjust it little bit.  So we should cope...

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 23ae9e9863ea90c6fb3f105403fd098041fa73f4)
2009-10-01 15:39:09 +10:00
Ronnie Sahlberg
dfc2500a1f dont exit on a commit failure
(This used to be ctdb commit 4e9a3a5dc232bac12ab387ea0cf4f1b279bed5c1)
2009-10-01 14:53:35 +10:00
Ronnie Sahlberg
63278ad040 Revert "Revert "allow the transaction commit to fail""
This reverts commit 74e416108df6934f45ca646d709785dd76ab3c35.

(This used to be ctdb commit d1d370033d5007ad1c2c34cd9eeac53001f4b13e)
2009-10-01 14:51:32 +10:00
Martin Schwenke
e976209996 Merge commit 'origin/master'
(This used to be ctdb commit 096cdc0c12d22d99f8405bee5cb9f05c616c8492)
2009-09-29 12:59:10 +10:00
Martin Schwenke
4948051bf4 Test suite: Print debug info on node status timeouts.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a083a1976d621c76121f1fa2c2f484cfa47267bd)
2009-09-25 18:00:17 +10:00
Michael Adam
d0289c650e Revert "dont check if commit failed, we do allow the commit to fail sometimes"
This reverts commit affa6f47432507e84b7e76b88a2c27fff8e6e2e4.

Transaction commit should not be allowed to fail.
This is a fatal error.

Michael

(This used to be ctdb commit 4364419a486c1995bea56dab603cc4960e7c8e7a)
2009-09-21 11:16:18 +02:00
Michael Adam
fcaca26ec4 Revert "allow the transaction commit to fail"
This reverts commit 7a6134e684c9ac4763bf198ef1410867b6082c94.

Transaction commit should not be allowed to fail.
This is a fatal error.

Michael

(This used to be ctdb commit 74e416108df6934f45ca646d709785dd76ab3c35)
2009-09-21 11:16:18 +02:00
Martin Schwenke
3d8fa9e9e3 Test suite: Update "complex" tests for wait_until_node_has_status() change.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 31216fd48117526c943e42d137ce24ef89fa0009)
2009-09-11 16:15:31 +10:00
Martin Schwenke
b8b28cb567 Test suite: wait_until_node_has_status() now uses "onnode any".
Many tests currently do this sort of thing:

  onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status 1 disconnected

In fact, they all use exactly the same "onnode 0 $CTDB_TEST_WRAPPER"
idiom.  This is both repetitious and dangerous, since node 0 might be
shutdown during a test.  Instead, we push "onnode any
$CTDB_TEST_WRAPPER" (which selects a connected node) into
wait_until_node_has_status() and just call that function directly in
tests, like this:

  wait_until_node_has_status 1 disconnected

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a2aaef03d4d6bbd4b42f50f732254935d4d3469c)
2009-09-11 15:55:53 +10:00
Martin Schwenke
7e09c07a34 Test suite: Rework the cluster (re)start code.
Make it possible to start on only 1 node - for tests that need to
restart a particular node.

_ctdb_hack_options() attempts to see what options are being passed to
a daemon that is being run via the initscript.  It then sets a
corresponding environment variable that the initscript knows about.
Currently only the --start-as-stopped option is supported.  This is
extremely ugly but it seems like the only way...  :-(

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 407b3117dfc1072117abf681ec98b9e252d8744c)
2009-09-11 14:06:12 +10:00
Ronnie Sahlberg
724afb2402 allow the transaction commit to fail
(This used to be ctdb commit 7a6134e684c9ac4763bf198ef1410867b6082c94)
2009-09-09 12:50:55 +10:00