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

155 Commits

Author SHA1 Message Date
Martin Schwenke
f7c414d4c9 ctdb-tests: Change "ctdb ip -n all" to "ctdb ip all"
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-10-23 03:43:26 +02:00
Martin Schwenke
a94378e3f1 ctdb-tests: Drop use of "ctdb delip -n all" in simple tests
Add new function delete_ip_from_all_nodes().  Also
ctdb_get_all_pnns().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-10-23 03:43:26 +02:00
Martin Schwenke
c607989d91 ctdb-tests: Drop simple uses of "ctdb -n all ..." from simple tests
None of these uses of -n are particularly useful.  "-n all" will be
deprecated.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-10-23 03:43:26 +02:00
Amitay Isaacs
e6ff36506c ctdb-recoverd: Add code for parallel database recovery
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-10-07 14:53:29 +02:00
Martin Schwenke
b933b91a0b ctdb-scripts: Update important installed files to use build-time defaults
In this case: ctdbd_wrapper, onnode, ctdb_diagnostics, ctdb.sudoers.
Set sensible defaults from configure options.

Update documentation to match, trying to fix up anything that has been
missed before.

The onnode unit tests need a symlink to the functions file.
The simple integration tests need to set CTDB_BASE and also
need symlinks to functions/nodes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

fixup

Signed-off-by: Martin Schwenke <martin@meltin.net>
2015-09-15 08:56:21 +02:00
Martin Schwenke
f4871b8736 ctdb-tests: Run transaction tests with externally imposed timeout
This works around cases where ctdb_transaction gets stuck - this still
needs to be debugged.  However, this change will at least cause
individual tests to fail rather than having whole test runs time out.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-07-01 04:18:28 +02:00
Martin Schwenke
0e89d586b2 ctdb-tests: Add new "ctdb setreclock" test
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Feb  4 05:40:55 CET 2015 on sn-devel-104
2015-02-04 05:40:55 +01:00
Martin Schwenke
d9d07fff34 ctdb-tests: Try to handle IPv6 addresses for local daemons
If CTDB_USE_IPV6 is set then use IPv6 addresses for nodes and public
IPs.  This can be useful for some simple tests.  However, the node
address actually needs to be on lo so that ctdbd can bind to the port
on that address, so they actually need to be added as root before
running tests, like this:

  for i in $(seq 1 10) ; do ip addr add "fc00:10::${i}/64" dev lo ; done

IPv4 127.0.0.0/8 addresses are somehow magic and only one needs to be
on lo so that many can be bound to.

Also change the IPv4 node addresses to be (slightly) more exotic.

For both IPv4 and IPv6, choose addresses that are compatible with
socket wrapper.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Amitay Isaacs <amitay@gmail.com> (socket wrapper fixes)
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net> (socket wrapper fixes)
2014-12-05 21:02:40 +01:00
Martin Schwenke
2a83b74597 ctdb-tests: Extend regexp to match IPv6 addresses
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-05 21:02:40 +01:00
Martin Schwenke
2c4de75d87 ctdb-tests: Update integration tests to use ctdb -X
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-05 21:02:40 +01:00
Martin Schwenke
1d1cd04cb9 ctdb-logging: New option CTDB_LOGGING, remove CTDB_LOGFILE, CTDB_SYSLOG
Remove --logfile and --syslog daemon options and replace with
--logging.

Modularise and clean up logging initialisation code.  The
initialisation API includes an app_name argument that is currently
unused - this will be used in extensions to the syslog backend.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-10-28 05:42:04 +01:00
Martin Schwenke
f4fc9a153c ctdb-logging: Remove debug levels DEBUG_ALERT and DEBUG_CRIT
Internally map them to DEBUG_ERR to limit code churn.

This reduces the unwieldy number of debug levels used by CTDB.  ALERT
and CRIT aren't of much use as separate errors, since everything from
ERR up should always be logged.  In future just ERR can be used.

This also improves compatibility with Samba's debug.c system priority
mapping.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-10-28 05:42:04 +01:00
Martin Schwenke
0eabbb8c2b ctdb-logging: Remove DEBUG_EMERG
It isn't used and shouldn't be.  CTDB can't make the system unusable.

Update associated test to ensure that EMERG isn't attempted.  Actually
test all remaining debug levels and modernise the test a bit.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-10-28 05:42:04 +01:00
Martin Schwenke
b544073653 ctdb-logging: Remove log ringbuffer
As far as we know, nobody uses this and it just complicates the
logging subsystem.

Remove all ringbuffer code and documentation.  Update the local
daemons startup code correspondingly.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-10-06 12:34:32 +02:00
Martin Schwenke
371543207e ctdb-tests: Clean up some tests where IP movement is checked
Some of this implements logic that exists in functions.  Some of it is
overly complicated and potentially failure-prone.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-09-23 08:06:12 +02:00
Martin Schwenke
81a8758b9b ctdb-tests: Remove dependency on log ringbuffer from missing IP test
The log ringbuffer will probably be removed.  The test can be
implemented just as reliably by checking IP assignments using "ctdb
ip".

Update wait_until_ips_are_on_node() to print a more useful log
message.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-09-23 08:06:12 +02:00
Martin Schwenke
81213af32a ctdb-tests: Factor out new function get_test_ip_mask_and_iface()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-09-23 08:06:12 +02:00
Martin Schwenke
4b8cfe4847 ctdb-tests: Simplify and rename wait_until_ips_are_on_nodeglob()
The glob functionality is unsed so simplify the code by removing it.
Rename this function to wait_until_ips_are_on_node().  Update all
calls.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-09-23 08:06:12 +02:00
Amitay Isaacs
3c1bae1221 ctdb-tests: Do not expect real-time priority when running local daemons
Local daemons are started mainly for testing and usually not as root.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-12 08:46:14 +02:00
Amitay Isaacs
bf7f2b06e8 ctdb-tests: Do not run ip command if running against local daemons
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Jul  8 12:48:06 CEST 2014 on sn-devel-104
2014-07-08 12:48:06 +02:00
Amitay Isaacs
eccce073d0 ctdb-tests: Add a test for ctdb restoredb
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Jul  7 16:06:39 CEST 2014 on sn-devel-104
2014-07-07 16:06:39 +02:00
Amitay Isaacs
9c8c8a7b0b ctdb-tests: Check that ctdb wipedb cleans the database
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-07-07 13:29:50 +02:00
Amitay Isaacs
fc71606480 ctdb-tests: Fix the tests for waf build
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:10 +02:00
Amitay Isaacs
b31240acaf ctdb-tests: Add test for re-attaching detached database
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-04-23 14:49:07 +02:00
Martin Schwenke
bf83abced4 ctdb-tests: Update "ctdb detach" test
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-04-23 14:49:07 +02:00
Amitay Isaacs
c048011cd6 ctdb-tests: Add a simple test for "ctdb detach"
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-04-14 03:52:40 +02:00
Martin Schwenke
aa7cd51bbc ctdb-tests: Fix and extend read-only records test
This test currently counts the number of read-only-enabled databases
and expects there to only be 1.  It fails when there are existing
databases with read-only already enabled.  Instead, check just the
test database.

Clean up the test by adding some functions to check for precisely the
read-only flags that should be set on a node after each operation.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-28 05:55:13 +01:00
Martin Schwenke
a9ccdec008 ctdb-tests: Handle interactions with monitor events
In the first case, reconfiguration can longer happen in a monitor
event, so this is no longer a problem.  Drop it.

Running a monitor event by hand no longer cancels the existing monitor
event.  Instead the hand-run event fails.  So do this differently and
just wait for a monitor event before continuing.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Feb 13 04:05:57 CET 2014 on sn-devel-104
2014-02-13 04:05:57 +01:00
Amitay Isaacs
dd98b9df66 ctdb-tests: Set CTDB_EVENT_HELPER when running with local daemons
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-01-16 12:11:38 +11:00
Martin Schwenke
f67a1043b3 ctdb/tests/integration: Decentralise the daemon restart code
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:43:55 +01:00
Martin Schwenke
f05db5edc4 ctdb/tests/integration: Update daemons shutdown pseudo-test
Don't scatter the TEST_LOCAL_DAEMONS logic around the code.  Limit it
to the local daemons file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:43:12 +01:00
Martin Schwenke
6b15fe247c ctdb/tests/simple: Local daemons version of setup_ctdb() overrides
setup_ctdb() doesn't need to do anything on a cluster.  To avoid a
conditional, just override it for local daemons.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:41:50 +01:00
Martin Schwenke
a3fd8ddf35 ctdb/tests/integration: Remove the time logging code
This hasn't been required for a long time and is probably broken.  If
it is needed in future then we know where to find it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:40:37 +01:00
Martin Schwenke
28acce2862 ctdb/tests/simple: Move the local daemons code to its own file
This is just a straight move.  The clever stuff will follow.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:39:59 +01:00
Michael Adam
e281cfa8db ctdb:tests:76_ctdb_pdb_recovery: change from using ctdb pstore to ctdb ptrans.
This removes the requirement to create a temporary file
and hence makes this test runnable against local daemons
and against a real cluster without further changes.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:13 +01:00
Michael Adam
30dead171f ctdb:tests:76_ctdb_pdb_recovery: fix a typo in a message
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:13 +01:00
Michael Adam
3e083f96ff ctdb:tests:76_ctdb_pdb_recovery: fix a typo in a message
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:12 +01:00
Martin Schwenke
bfbf62b6c9 ctdb:tests/simple: Nobody looks at /tmp/recloop.out so use /dev/null instead
Otherwise this should use mktemp, something should look at the output
and the file should be removed.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Nov 27 20:39:00 CET 2013 on sn-devel-104
2013-11-27 20:39:00 +01:00
Martin Schwenke
a8f2791a9d ctdb-tests/integration: Neaten up some of the persistent database tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Martin Schwenke
c6551132f5 ctdb-tests/simple: User sleep_for() instead of sleep
Progress...

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Martin Schwenke
2b6db9041d ctdb-tests/simple: Update persistent DB tests
* Low level DB checks should ignore the sequence number record.

* A restart is needed after messing with the RecoverPDBBySeqNum
  tunable.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Martin Schwenke
e850cddcc4 ctdb-tools/ctdb: New ptrans command
Also add test.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:16 +01:00
Amitay Isaacs
296bd44c04 ctdb-tests: CTDB tool should always be invoked as $CTDB instad of ctdb
$CTDB_TEST_WRAPPER is required only to run test functions or test binaries
on remote nodes.  For running ctdb command, $CTDB is sufficient.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:15 +01:00
Amitay Isaacs
c91394c950 ctdb-tests: No need to run onnode in parallel for single node
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:15 +01:00
Amitay Isaacs
780391c0ba ctdb-tests: Remove -q option to try_command_on_node
This option is always passed to onnode by default.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:15 +01:00
Amitay Isaacs
25f3c8b526 tests: Fix calling of ctdb tool from test
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 9381c33dfd40192b7532d942059c2959dfae059d)
2013-11-07 16:08:44 +11:00
Amitay Isaacs
524696fa26 tests: No need to set sequence number when modifying persistent database
With the new persistent transaction code, sequence numbers will be
automatically updated whenever a record is updated.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 961dd5d0acbb971756944ea9f69992020ea7d9fc)
2013-10-04 15:47:11 +10:00
Amitay Isaacs
e4ed152d59 tests: Add a simple test to test cluster wide database traverse
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 713c9ecc791e3319a2d109838471833de5a158c8)
2013-09-26 10:21:31 +10:00
Martin Schwenke
44b7397962 tests/simple: Fix the reloadips test to cope with changes to reloadips
Specifying nodes to reload no longer uses -n.

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

(This used to be ctdb commit d921b2756d5f1c4ad7a35fe120f6fda9f5bf5686)
2013-09-19 12:54:32 +10:00
Martin Schwenke
1c3f4f55b0 tests/simple: Minimise the chance of a monitor event being cancelled
A monitor event following a "ctdb delip" might reconfigure services.
If the monitor event is cancelled then a service might be stopped but
not yet restarted and this could result in the subsequent monitor
events failing.

This obviously needs to be fixed in CTDB itself.  This will happen by
making "ctdb reloadips" the supported way of reconfiguring IPs.

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

(This used to be ctdb commit 618ea3660e36e7bd92b686e1ca8728cf63c3c068)
2013-08-22 17:00:20 +10:00