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

453 Commits

Author SHA1 Message Date
Michael Adam
9936e1cf0f tests: fix segfault in randrec test when connection to daemon fails.
(This used to be ctdb commit 715999d7ffbf10f3a57de3ee08a293165333553a)
2011-03-09 11:19:28 +01:00
Ronnie Sahlberg
b2d7554b32 Add a new test tool that fetch locks a record and then blocks until it receives
user input to unlock the record again.

(This used to be ctdb commit 1b3c5278aa1bf712606e2ec138e6be7b2e8a6ad1)
2011-01-24 12:21:46 +11:00
Martin Schwenke
44d66153af Test suite: fix typo in ctdb ping test grep pattern.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ad18bfa398e582474afe25340368e39d4e74e3c6)
2010-11-17 11:39:51 +11:00
Martin Schwenke
0ff7924d15 Test suite: match changed output for ctdb ping to disconnected node.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a9f5ae2a548e1096c086888adc886cb604d372fa)
2010-11-17 11:38:45 +11:00
Martin Schwenke
bcb6e726b6 Test suite: make statistics test cope with changes to statistics output.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9e88466a99b5245d5f0ebab553be8d2b9b9a58e2)
2010-11-17 11:35:05 +11:00
Martin Schwenke
46b9110f88 Test suite: Make NFS tickle test more flexible.
Use onnode any where possible rather than a fixed node.

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

(This used to be ctdb commit 51561720d2b4db5b307da3d410661075e2a6c3ca)
2010-08-27 11:43:50 +10:00
Martin Schwenke
9878f8cbc2 Test suite: Fix NFS tickle test.
We now kill ctdbd on the test node instead of disabling it.  This
ensures that the only tickles we see will come from the takeover node.

We also sleep for TickleUpdateInterval before checking for asking ctdb
about the tickles.

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

(This used to be ctdb commit 48cd8325c070f6942aa13a25269021e4c8ed188f)
2010-08-27 11:40:44 +10:00
Martin Schwenke
68717f689d Test suite: Tweak NFS tickle test.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c32ffd203e42a39010ce2d6e98253e8e48de515a)
2010-08-26 17:56:50 +10:00
Martin Schwenke
d7b169be9a Test suite: Fix typos in NFS tickle test.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c35d3e6341bc4e288393efa429b68bf6568b9b11)
2010-08-26 15:50:35 +10:00
Martin Schwenke
9235dc727a Test suite: NFS tickle test uses gettickles if events.d/61.nfstickle missing.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4763ccbfeaedd0fd953dbeda17ef9af41386688b)
2010-08-26 15:28:19 +10:00
Martin Schwenke
0d2c554d5f Test suite: in the test eventscript, run "ctdb" not "$CTDB".
It is too hard to do anything else...

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

(This used to be ctdb commit 08b636b500855e38e708e6963d8e63ded97c25ec)
2010-08-26 14:04:03 +10:00
Martin Schwenke
f2e2abbaad Merge branch 'master' of git://git.samba.org/sahlberg/ctdb
(This used to be ctdb commit 718ddc2264c28185fcddbc9cb0c7137d198a43a7)
2010-08-24 11:53:29 +10:00
Martin Schwenke
4e9fe3545c Test suite: loosen the getmonmode test.
Monitoring could be off at the beginning of the test.

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

(This used to be ctdb commit 6a33a7715067175869ea2f3f15b64c3371079a6b)
2010-08-18 11:25:44 +10:00
Ronnie Sahlberg
ddf3c621c1 Merge commit 'rusty/libctdb-new' into foo
(This used to be ctdb commit 1566d2d23ab698896b3b6a76974a5c7452db4a62)
2010-08-18 09:53:52 +10:00
Rusty Russell
f93440c4b7 event: Update events to latest Samba version 0.9.8
In Samba this is now called "tevent", and while we use the backwards
compatibility wrappers they don't offer EVENT_FD_AUTOCLOSE: that is now
a separate tevent_fd_set_auto_close() function.

This is based on Samba version 7f29f817fa.

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


(This used to be ctdb commit 85e5e760cc91eb3157d3a88996ce474491646726)
2010-08-18 09:16:31 +09:30
Martin Schwenke
a3e9fe2058 Test suite: Add more timestamping of debugging information.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4cdf3b9adc7edfd80a2901ef8457ae67aab0829a)
2010-08-17 09:55:48 +10:00
Martin Schwenke
e28d2b8f22 Test suite: print date/time at test completion.
This should help with log cross-checking.

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

(This used to be ctdb commit c0a916c40c623c0aa8245526283a064dbeea4b57)
2010-08-17 09:52:15 +10:00
Martin Schwenke
03aa9ee702 Test suite: strengthen function _cluster_is_healthy().
If there's a chance that "ctdb status -Y" can return 0 but print
garbage then this function might return a false positive.

So, we do 2 things:

* Redirect stderr to >/dev/null rather than looking at it.  This
  minimises the chance that we will see garbage.

* Since we need at least 1 good line to decide the cluster is healthy,
  we sanity check each line to esnure it starts with :[0-9].

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

(This used to be ctdb commit d4189c7c3fceaa833f9f0446a2b06af6fed714ec)
2010-08-13 17:01:54 +10:00
Martin Schwenke
a9fb1e318b Test suite: use $CTDB rather than ctdb everywhere in ctdb_test_functions.sh.
Also ensure that $CTDB is set by default it to "ctdb".

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

(This used to be ctdb commit 8222fef1e61836b9bfd406205f9ffb9396aa7480)
2010-08-12 14:13:07 +10:00
Martin Schwenke
00fec0e76c Test suite: improve wait_until_node_has_status()
This currently does "onnode any ... wait_until ...".  If ctdbd is
being shutdown on a node then that node might be chosen anyway, if it
is asked early enough.  Then we'll loop on that node but our ctdb
client command may always fail, causing a timeout rather than the
expected behaviour.

This puts the loop on the outside of the "onnode any" so that if the
"wrong" node is chosen initially then on the next iteration the choice
can be remade.

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

(This used to be ctdb commit a88ee78686bd5aa2b789f5959e0562315a13525d)
2010-08-12 13:48:33 +10:00
Martin Schwenke
d549c31031 Test suite: make addip test use $CTDB rather than ctdb in debug code.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5bb6b28ab7b45b7242d100ae8f1483d02e1d0d1d)
2010-08-11 16:55:33 +10:00
Martin Schwenke
b50ec65963 Test suite: remove unnecessary verbosity from enable/continue tests.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 69c95b2a42f55b80cd8d91a90ab55166f964163b)
2010-08-05 16:03:21 +10:00
Martin Schwenke
f66b5b46d6 Test suite: Fix typo in continue test.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c2bce140da7c4b118394ee77bb9d0348d27e7e95)
2010-08-05 16:01:23 +10:00
Martin Schwenke
77ad2be488 Test suite: weaken ctdb continue/enable tests for non-deterministic IPs.
These tests currently wait for the old IPs to fail back to the test
node.  This isn't guaranteed with DeterministicIPs disabled.

This changes those tests to wait until the test node gets at least 1
IP assigned.

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

(This used to be ctdb commit e9b3f5b1b51d541a911a27eb4348b368f28d185e)
2010-08-05 15:58:56 +10:00
Martin Schwenke
774582c360 Test suite - make the ctdb_fetch test cope with "Reqid wrap!" messages.
Recent CTDB notice the wrap and print this message.  The test needs to
cope.

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

(This used to be ctdb commit b93b60ec96d02ce4f54921e85a5c5554d1fc0c55)
2010-08-05 13:43:50 +10:00
Martin Schwenke
dff9282917 Test suite: remove thaw/freeze tests.
They test debugging commands that no longer operate as expected.

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

(This used to be ctdb commit d33fa4d6557aab1938049f194c2de55f2c395bd2)
2010-08-05 11:40:05 +10:00
Martin Schwenke
4817f7e4ba Test suite - fix addip test.
The test currently checks that all existing IPs plus the newly added
IP are on the test node after "ctdb addip" is run.  With
DeterministicIPs enabled, if the new IP is "before" other IPs then the
other IPs may be shuffled by the deterministic IPs modulo algorithm.
This will happen on the 1st recovery after the move.  Sometimes this
recovery happens before we get the list of IPs to check and sometimes
after, so the test is racy.

The fix is to simply check for the presence of the new IP and not
worry about the others.  This reduces whatever value this test
had... but you can't have everything.

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

(This used to be ctdb commit 1ef7c8e64c7a39330be09ae4d00b70238133e0b5)
2010-08-04 16:08:12 +10:00
Martin Schwenke
9aa6a99740 Merge remote branch 'martins/master'
(This used to be ctdb commit 5d9e4b6ee7d2b5290a74e7be79bdf51a43b72f43)
2010-08-04 16:05:39 +10:00
Martin Schwenke
7edcb89857 Test suite - try to make addip test more reliable and add some debugging.
This test is failing in some situations.  The "ctdb addip" command
works but the IP never appears in the "ctdb ip" output.

Try restricting the last octet to be between 101-199.  At the moment
addresses like 10.0.2.1 are being chosen and these are often the
address of the host machine in autocluster configurations... so might
cause weirdness.

Also add some debugging if checking for the IP address times out.

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

(This used to be ctdb commit ae52cb63756bc60de8d32e01bac5d70975a1c7a0)
2010-08-04 13:16:06 +10:00
Martin Schwenke
807567e992 Testing: IP allocation simulation - add option to change odds of a failure.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b2a2e301025d7fbfe5eeaac436693cde6d404490)
2010-08-03 11:51:14 +10:00
Martin Schwenke
4ffb6495ff Testing: IP allocation simulation - clean up usage message.
Group options better and make the language consistent between options.

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

(This used to be ctdb commit bc38c17e4115fae00c89d00537fdcfe621111b37)
2010-08-03 11:41:50 +10:00
Martin Schwenke
4728bf6ece Testing: IP allocation simulation - print maximum number of unhealthy nodes.
This can imply something about imbalance.

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

(This used to be ctdb commit ecb80e2b6be9326708d1fc87ad3028c6836d5858)
2010-08-03 11:37:34 +10:00
Martin Schwenke
8ca925fe5d Testing: IP allocation simulation - improve help for options.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 058501b92f602e7d2240d1cb08ed78a807564c48)
2010-08-03 11:36:33 +10:00
Martin Schwenke
8cc6ed1d0e Testing: IP allocation simulation - make usage/failure more obvious.
Tweak the usage message for -g option.

Print an error if no node groups defined, instead of curious Python
error.

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

(This used to be ctdb commit 8b883eb9346b8278d268e35b56ac680cd9526b97)
2010-08-02 15:46:23 +10:00
Martin Schwenke
326514f152 Testing: IP allocation simulation - rename an example to node_group_extra.py.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 974f849df0aca2cfedb38fa815894955e32803a8)
2010-08-02 15:09:13 +10:00
Martin Schwenke
d438b2398f Testing: IP allocation simulation - rename an example to node_group_simple.py.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 0a2a5602233a8208e2729192e50d816faed0151a)
2010-08-02 15:07:56 +10:00
Martin Schwenke
4af049780a Testing: IP allocation simulation - add general node group example.
This allows node pool configuration to be specifed on the
command-line.

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

(This used to be ctdb commit d382d9023928f75f360a115ae1e9c1036423416e)
2010-08-02 15:06:39 +10:00
Martin Schwenke
0fdd7566c7 Testing: IP allocation simulation - update options processing in examples.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a65ca1a71386f40080dd553756f3600d3b20d523)
2010-08-02 15:01:47 +10:00
Martin Schwenke
ecdbd99557 Testing: IP allocation simulation - Update README.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ed64b7f2b3cd920bb0f5dfd7f64ed0afc0b99fc1)
2010-08-02 14:58:15 +10:00
Martin Schwenke
ae0f339173 Testing: IP allocation simulation - fix nondeterminism in do_something_random().
The current code makes random choices from unsorted lists.  This
ensures the lists are sorted.

Also, make the code easier to read by doing the random selction from
lists of PNNs rather than lists of Node objects.

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

(This used to be ctdb commit a01244499dc3567f5aa934b1864b9bc183a6c242)
2010-08-02 14:24:00 +10:00
Martin Schwenke
eac5edf322 Testing: IP allocation simulation - Tweak options handling and Cluster.diff().
process_args() must now be called by programs inporting this module.
Options are put into global variable "options", which can be
references using "ctdb_takeover.options".

Can now pass extra option specifications to process_args().

Remove global variable prev and make it a Cluster object variable.

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

(This used to be ctdb commit a32298e7bc819694518e859f100f9444ff5663cd)
2010-08-02 14:20:12 +10:00
Martin Schwenke
ef77f613fa Testing: IP allocation simulation - update copyright message.
There's a lot of new code here, so let's make the copyright message
make sense.

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

(This used to be ctdb commit e6e56e5989def6704b116e806c1f261c7f3fc03f)
2010-08-02 14:16:02 +10:00
Martin Schwenke
de4223fa54 Testing: IP allocation simulation - add command line option for random seed.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 8362029c7cfc1041e46ee2116aa5cade6edce435)
2010-08-01 11:53:28 +10:00
Martin Schwenke
2e570851d5 Testing: IP allocation simulation - save some warnings for verbose mode.
We don't need to see warnings about unallocatable IPs unless we're in
verbose mode.  Can node be run with -n (and without -v or -d) to see
just the statistics.

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

(This used to be ctdb commit 55370936ac5def5ebf138910388a2ddc2df9c20f)
2010-08-01 11:41:52 +10:00
Martin Schwenke
d7d2c64834 Testing: IP allocation simulation prints final imbalance in statistics.
This is useful to know.  When things get unbalance they tend to stay
that way.

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

(This used to be ctdb commit a40faa2096effc2657ac05b729f3259bbb2e1fed)
2010-08-01 11:41:02 +10:00
Martin Schwenke
d7e996915c Testing: In IP allocation simulation count total number of events.
This starts at -1 because we always have to do the initial allocation.

No longer print event number for each event by default, only when
verbose is enabled.

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

(This used to be ctdb commit c9a761726d141bcaa8ba7851150f71a8130b473a)
2010-08-01 11:39:30 +10:00
Martin Schwenke
88337cb080 Testing: Add imbalance information to IP allocation simulation.
Implement the imbalance calculations.

Also add command-line option to display imbalance for each step.

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

(This used to be ctdb commit f50a12f6d06ed67efadd2a892d62c01e67310e7d)
2010-08-01 11:37:35 +10:00
Martin Schwenke
7c939e5fbf Testing: Add Python IP allocation simulation.
Includes simulation module and example scenarios.  This allows you to
test and perhaps tweak an algorithm that should be the same as the
current CTDB IP reallocation one.

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

(This used to be ctdb commit 10e701fa9bba2a166c947a5a18f231ff64d9b861)
2010-07-30 16:45:36 +10:00
Martin Schwenke
1c6163935a Test suite: handle extra lines in statistics output.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a476a56da2219c1047081032595c045f65f8ad3f)
2010-07-26 15:28:59 +10:00
Martin Schwenke
a354d7e271 Test suite: handle change to disconnected node error message.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d75d7b49cf729bace820b3225e5c6d069bbcbc53)
2010-07-26 15:28:54 +10:00
Ronnie Sahlberg
bc208bc916 rename ctdb_set_message_handler to ctdb_client_set_message_handler
to avoid a colission with the function of the same name in libctdb

(This used to be ctdb commit 41dbdd4fc0ab560420fb0e24a3179ff7c94c5bb7)
2010-06-02 09:51:47 +10:00
Ronnie Sahlberg
761a075de9 rename ctdb_send_message to ctdb_client_send_message to resolve colission with the function of the same name in libctdb
(This used to be ctdb commit ac3292c12832484a22715f1d46aa23f3b7c8a6f6)
2010-06-02 09:45:21 +10:00
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
Ronnie Sahlberg
f9c1f632e0 Merge commit 'martins/master'
(This used to be ctdb commit 12e14a09dd28ed005c8eb8fca7cd38a96aab938e)
2009-09-09 12:50:21 +10:00
Ronnie Sahlberg
26f73e4504 dont check if commit failed, we do allow the commit to fail sometimes
(This used to be ctdb commit affa6f47432507e84b7e76b88a2c27fff8e6e2e4)
2009-09-09 12:48:21 +10:00
Martin Schwenke
9d03cfde3a Test suite: fix minor typo in complex/32_cifs_tickle.sh
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit cd65d8acb97aa9f83ff0d0585bf09caef2d2f3eb)
2009-08-27 12:35:52 +10:00
Martin Schwenke
1bde47212d Test suite: Fix debug code for unexpectedly unhealthy cluster.
The debug code should run "ctdb status" on a cluster node, not on the
test client.

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

(This used to be ctdb commit 448cd8db1305c1e6dfab323f92eac4a576596e4e)
2009-08-27 12:32:16 +10:00
Martin Schwenke
bd98b6c699 Test suite: ctdb_persistent.c needs to use transactions.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 49de8429d2a996dc055370541a12ea36762abe94)
2009-08-14 20:47:38 +10:00
Martin Schwenke
7207e1b837 Merge commit 'origin/master'
(This used to be ctdb commit 0e9c3e0cf76dd33a24241f02709e56bc330f009a)
2009-08-12 08:48:03 +10:00
Michael Adam
6cf67b9bb0 tests: fix the 52_ctdb_fetch.sh test.
The parser for the output of the ctdb_fetch program
did not match the output that ctdb_fetch generates.
It seemed to rather come from the ctdb_bench test...

This patch adapts the parser to correctly interpret
the output of ctdb_fetch.

Michael

(This used to be ctdb commit 836b95f32724cf37e4f643f20653f78842613692)
2009-08-04 09:46:40 +02:00
Martin Schwenke
1cfed53659 Merge commit 'origin/master'
(This used to be ctdb commit abf4540bfb06de56b0a7b5976b5f1b2a24a8743d)
2009-07-31 11:04:37 +10:00
Martin Schwenke
7d1203e4c2 Test suite: Retrieval NFS_TICKLE_SHARED_DIRECTORY more defensively.
In complex/31_nfs_tickle.sh we run sed against a file that might not
exist, causing potential garbage from stderr in the output.  Check
that the file exists before running sed.

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

(This used to be ctdb commit f9b71757f034732647228d4b8a8f00528028b6b0)
2009-07-30 14:10:34 +10:00
Martin Schwenke
d7981fdcda Test suite: Better diagnostics for recent change to complex/31_nfs_tickle.sh.
Add a -v so we see the output of the command that tries to get the
value of NFS_TICKLE_SHARED_DIRECTORY.  That way we can tell if a value
was retrived OK or if we're using the default.

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

(This used to be ctdb commit c53353c6402f378f29200313d82f1f9262d628b1)
2009-07-30 14:03:44 +10:00
Martin Schwenke
aed71a760d Test suite: complex/31_nfs_tickle.sh should use NFS_TICKLE_SHARED_DIRECTORY.
Rather than hardcoding the location of the shared tickle directory,
attempt to use the value of NFS_TICKLE_SHARED_DIRECTORY from
/etc/sysconfig/nfs on node 0.

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

(This used to be ctdb commit 878437a909ea44dfc3635f082e34741ee256e505)
2009-07-30 13:57:40 +10:00
Martin Schwenke
e47328742d Test suite: Ask CTDB about CIFS tickles registered for the actual test node.
This failed when node 0 had no public IPs because we would always run
"ctdb gettickles" on node.  We now ask node 0 for the tickles on the
test node.

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

(This used to be ctdb commit 8fcc4610de926f44e18ec85fb57ca5f7d3c28bd6)
2009-07-30 13:45:06 +10:00
Martin Schwenke
3d91b6442e Test suite: Turn off strict host key checking in the SSH failover test.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b7787255391eddef8458f81ff9b75d9116e2afd3)
2009-07-30 13:20:23 +10:00
Ronnie Sahlberg
690f1537f0 Merge commit 'martins/master'
(This used to be ctdb commit 32a69b0efa078b069802470be6488a4efe32961d)
2009-07-30 10:55:56 +10:00
Martin Schwenke
063bd6e278 Test suite: fix test file permissions in complex/44_failover_nfs_oneway.sh.
Something, perhaps root_squash, causing permission denied on the test
file after we copy it over with scp.  This sets the initial
permissions to be friendly and adds -p to the scp command to maintain
those friendly permissions.

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

(This used to be ctdb commit 52f21f5a92eb14df7540a2ae9e212d936e646c06)
2009-07-30 10:47:36 +10:00
Martin Schwenke
73ca4b6c8b Test suite: fix the test suite's generic event script.
Add a "stopped" case to log events and stop the event script from
failing with an unknown event.

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

(This used to be ctdb commit 7f67f7395e2233f0bba2e9662404aad49e13f645)
2009-07-29 18:10:05 +10:00
Martin Schwenke
48078dd24f Test suite: Fixes for node state parsing plus new stop/continue tests.
The parsing of "ctdb status -Y" output to determine various node
states was implemented very strictly.  Therefore, the parsing broke
due to the addition of the new "stopped" state to the output of "ctdb
status -Y".  This relaxes the parsing so that it should work for
versions prior to the introduction of the "stopped" state, as well as
future versions that add new states to the end of the list of bits in
output of "ctdb status -Y".

Similarly the check for cluster unhealthy (in _cluster_is_healthy())
now just checks for a single 1 in any bit in the "ctdb status -Y"
output, rather than checking for a particular number of 0s.

New tests
tests/simple/{41_ctdb_stop.sh,42_ctdb_continue.sh,43_stop_recmaster_yield.sh}
do rudimentary testing of the stop and continue functions.

Remove tests tests/simple/41_ctdb_ban.sh and
tests/simple/42_ctdb_unban.sh.  They were both unreliable.

tests/simple/21_ctdb_disablemonitor.sh now schedules a restart, since
one will be required.

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

(This used to be ctdb commit 67c5bfb5f02c9d45a32d976021ede4fb2174dfe9)
2009-07-29 18:01:07 +10:00
Ronnie Sahlberg
cca0aae1f5 From Michael Adam:
Update the transaction test tool to the new api for transactions

(This used to be ctdb commit 4d9a53f142deba6ab578af2fc35bfa99c29c3a99)
2009-07-29 11:18:02 +10:00
Ronnie Sahlberg
366d413f2b new version 1.0.87
(This used to be ctdb commit d187eb8507f35a650ff3ffc50fa49110eebca0bd)
2009-07-17 13:01:11 +10:00
Martin Schwenke
d846eb78db Test suite: Fix debug code for unexpectedly unhealthy cluster.
The debug code should run "ctdb status" on a cluster node, not on the
test client.

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

(This used to be ctdb commit 34e6f8a04b12f8879eb42d417f9741502ccccf0f)
2009-07-16 14:04:06 +10:00
Martin Schwenke
168ec02adf Test suite: new tests and code factoring.
* 2 new tests for NFS failover.

* Factor repeated code from tests into new functions
  select_test_node_and_ips(), gratarp_sniff_start() and
  gratarp_sniff_wait_show().  Use these new functions in existing and
  new tests.

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

(This used to be ctdb commit de0b58e18fcc0f90075fca74077ab62ae8dab5da)
2009-07-08 13:37:52 +10:00
Martin Schwenke
96b3517356 Test suite: better debug info when the cluster is unexpectedly unhealthy.
cluster_is_healthy() is now run locally in tests and internally causes
_cluster_is_healthy() to be run on node 0.  When it detects that the
cluster is unhealthy and $ctdb_test_restart_scheduled is not true,
debug information is printed.  This replaces the previous use of
$CTDB_TEST_CLEANING_UP.

To avoid spurious debug on expected restarts, added scheduled
restarts to several tests.

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

(This used to be ctdb commit ee7caae3a55a64fb50cd28fa2fd4663c5dd83b4f)
2009-07-06 17:52:11 +10:00
Martin Schwenke
d90d54ea3e Make ctdbd restarts in tests more reliable.
This works around potential race conditions in the init script where
the restart operation is not necessarily reliable.  It just wraps the
actual restart in a loop and tries for a successful restart up to 5
times.

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

(This used to be ctdb commit 1cac8a0ad429f29d1508158c7f7c42a2f1a22945)
2009-07-06 16:40:31 +10:00
Martin Schwenke
35f998346e When testing make the time taken for some operations more obvious.
If wait_until() does not timeout, print the time taken for the command
to succeed.

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

(This used to be ctdb commit bdb856ee22816ae1f6b8d15856555f488054f489)
2009-07-06 16:39:08 +10:00
Martin Schwenke
5d67aa2332 New tests for different aspects of failover.
3 separate tests:

* Check that gratuitous ARPs are received and take effect.

* Check that ping still works after failover.

* Check, via SSH, that the hostname changes after failover.

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

(This used to be ctdb commit 92011cc05bbdb517ec6a4573f5cb9f6f21c3059e)
2009-07-03 20:55:02 +10:00
Martin Schwenke
613341d150 Updates to TCP tickle tests and supporting functions.
* Removed a race from tpcdump_start().  It seems impossible to tell
  when tcpdump is actually ready to capture packets.  So this function
  now generates some dummy ping packets and waits until it sees them
  in the output file.

* tcpdump_start() sets $tcpdump_filter.  This is the default filter
  for tcpdump_wait() and tcpdump_show(), but other filters may be
  passed to those functions.

* New functions tcptickle_sniff_start() and
  tcptickle_sniff_wait_show() handle capturing TCP tickle packets.
  These are used by complex/31_nfs_tickle.sh and
  complex/32_cifs_tickle.sh.

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

(This used to be ctdb commit 8e2a89935a969340bfead8ed040d74703947cb81)
2009-07-03 20:44:55 +10:00
Martin Schwenke
7b3abce684 Add an extra ctdb recovery to test function restart_ctdb().
There are still very rare cases where IPs haven't been reallocated
before the beginning of the next test, so this adds a sleep and an
extra call to "ctdb recover" to restart_ctdb().

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

(This used to be ctdb commit c2bdb77d91761c003e2f0e6918a27c54150f6030)
2009-07-03 18:01:29 +10:00
Martin Schwenke
dba6c1ca77 Fix the run_tests script so that the number of columns is never 0.
Sometimes "stty size" reports 0, for example when running in a shell
under Emacs.  In this case, we just change it to 80.

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

(This used to be ctdb commit e309cb3f95efcf6cff7d7c19713d7b161a138383)
2009-07-03 17:58:38 +10:00
Martin Schwenke
0d425a07d4 Separate test cleanup code in output and clean up ctdb restart code.
* ctdb_restart_when_done() now schedules a restart by setting an
  explicit variable that is respected in ctdb_test_exit(), rather than
  adding a restart to $ctdb_test_exit_hook.  This means that restarts
  are all done in one place.

* ctdb_test_exit() turns off "set -e" to make sure that all cleanup
  happens.

* ctdb_test_exit() now prints a clear message indicating where the
  test ends and the cleanup begins.  This message also includes the
  return code of the test.

* Add debug in cluster_is_healthy to try to capture information about
  unexpected unhealthiness when a test starts.

* Simplify simple/07_ctdb_process_exists.sh so that the exit code is
  generated more obviously.

* Remove redundant calls to ctdb_test_exit at the end of tests, since
  they're done automatically via a trap.  Also remove any preceding
  warnings of restarts or final hints about test success/failure.

* Allow multi-digit debug levels in simple/12_ctdb_getdebug.sh and
  simple/13_ctdb_setdebug.sh.

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

(This used to be ctdb commit b6fa044a1364cbb3008085041453ee4885f7ced1)
2009-07-03 17:40:16 +10:00
Martin Schwenke
62871fbcd5 Clean up handling the of CTDB restarts in testcases.
Glitches during restarts of the CTDB cluster have been causing some
tests to fail.  This is because restarts are initiated in the body of
many tests.  This adds a simple function ctdb_restart_when_done, which
schedules a restart using an existing hook in the test exit code.
This function is now used in tests that need to restart CTDB.

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

(This used to be ctdb commit d440e83bb4f0c19c085915d0f0e87cc0dabbc569)
2009-06-19 11:40:09 +10:00
Martin Schwenke
ffff61c13b New tests for NFS and CIFS tickles.
New tests/complex/ subdirectory contains 2 new tests to ensure that
NFS and CIFS connections are tracked by CTDB and that tickle resets
are sent when a node is disabled.

Changes to ctdb_test_functions.bash to support these tests.

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

(This used to be ctdb commit 31cc46eb157ca1301312f14879e4fb4da7d81088)
2009-06-16 12:47:59 +10:00
Martin Schwenke
ad3c89095e Make 51_ctdb_bench.sh more tolerant.
Limit the allowable difference in message counts in either direction
around the ring to 5% (up from 2%).  There is something environmental
making this blow out to 3% very occasionally when there's no obvious
problem with ctdb.

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

(This used to be ctdb commit d6e6909ac629212b3028e13b958e1a17c64bee8c)
2009-06-10 16:15:09 +10:00
Sumit Bose
887046352d fix re pattern to accept the new recovery lock times in the statistics output
(This used to be ctdb commit ba44aae7307b4fa56f7b2da2cd9d4a7ccd0a135e)
2009-05-25 11:15:00 +10:00
Ronnie Sahlberg
26e1486db7 Whitespace changes and using the CTDB_NO_MEMORY() macro changes to
the previous patch.

(This used to be ctdb commit d623ea7c04daa6349b42d50862843c9f86115488)
2009-05-21 11:49:16 +10:00
Sumit Bose
2fcedf6dac add missing checks on so far ignored return values
Most of these were found during a review by Jim Meyering <meyering@redhat.com>

(This used to be ctdb commit 3aee5ee1deb4a19be3bd3a4ce3abbe09de763344)
2009-05-21 11:22:21 +10:00
Martin Schwenke
2a09b4bad3 In 51_ctdb_bench.sh now allows a 2% difference between positive and
negative.  ctdb_bench.c checks to ensure the timer has advanced from 0
before dividing.

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

(This used to be ctdb commit 723413f246399b25166462d2018237920515655f)
2009-05-12 14:45:46 +10:00
Martin Schwenke
d59cd199e4 Avoid floating point divide by 0 in ctdb_fetch.c's bench_fetch().
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3c67e164eb92591f8763883430490805c1dfa9ed)
2009-05-12 14:45:14 +10:00
Martin Schwenke
7c7c5b3489 Bug fixes for tests: simple/12_ctdb_getdebug.sh and scripts/test_wrap.
simple/12_ctdb_getdebug.sh now recognises output with multi-digit node
numbers.

Sharing the ctdb directory via NFS and testing on a real cluster by
setting CTDB_TEST_REAL_CLUSTER didn't work by default.  The fix is to
hack scripts/test_wrap so that it tries to find a valid bin directory
next to the directory containing it is in.

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

(This used to be ctdb commit ea2ca769e1d1068fbbad843750b19acfd87360e0)
2009-05-12 14:44:30 +10:00
Martin Schwenke
9666d7bf0a Use ctdb_fetch_lock rather than ctdb_call.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5f3d2e29a446972ac244e20a08e48f4c2f4ffef4)
2009-05-12 08:55:36 +10:00
Andrew Tridgell
a0c86e4013 Merge commit 'ronnie/master'
(This used to be ctdb commit 1a110993af1706e0c5df500fa7d14e16c0668372)
2009-02-09 10:53:47 +11:00
Michael Adam
b183acf467 add a simple test script to test ctdb_check_tcp_ports
Michael

(This used to be ctdb commit 2634f1bd216ce18f061a282a53314cb1650dbd05)
2009-01-30 22:49:17 +01:00
Martin Schwenke
1b61a149f4 Make message in 62_ctdb_persistent_unsafe.sh more informative.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4777b74b1e2eebe54cf27f3303f60e49023e7f6a)
2009-01-16 15:50:33 +11:00
Martin Schwenke
fc1f71ce0f 23_ctdb_moveip.sh sanity checks the list of IPs/nodes instead of
looping forever on older versions of CTDB.

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

(This used to be ctdb commit 03dfcf9f284c9926479a8dd4e5acf1f5d2b964aa)
2009-01-16 15:12:40 +11:00
Martin Schwenke
7c6153e6aa Remove the sorts from 06_ctdb_getpid.sh - the PIDs should be listed in
node order.

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

(This used to be ctdb commit 4b97bdba3bc4df20efb1aae7d89a1e3430d35ca3)
2009-01-13 17:02:59 +11:00
Martin Schwenke
5038a0d08a Use $CTDB_TEST_WRAPPER in other tests that need it.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 2912c1ade5db1e20bfa3a8017a702cc8a7da36f1)
2009-01-13 14:55:31 +11:00
Martin Schwenke
cb09075891 Use $CTDB_TEST_WRAPPER in 51_ctdb_bench.sh.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 44ec4c57bf9928ef5d5cc117a6c2d92495dac489)
2009-01-13 14:51:40 +11:00
Martin Schwenke
38593aa3e1 For now, make tests/run_tests.sh runs the new test suite. Add
tests/TODO.  Remove tests/start_daemons.sh - no longer used.

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

(This used to be ctdb commit 5cdbef46b74e6a5ba2383ef025e69fe605fa4f6e)
2009-01-12 15:47:12 +11:00
Martin Schwenke
2e87ed4e9d Test binaries now go in tests/bin and ctdb_test_env now adds this
directory to $PATH if local daemons are being used.

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

(This used to be ctdb commit a497010f67d6a8e68f4d6d7e516b88d2261b1062)
2009-01-09 18:15:06 +11:00