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

262 Commits

Author SHA1 Message Date
Martin Schwenke
a7a5216968 ctdb-tests: Use setup_ctdb_base() for simple tests
The comment in local.bash is incorrect.  CTDB_BASE will never be set
here because this script is not run under onnode.  Instead, this where
CTDB_BASE needs to be set when running against a real cluster.

For local daemons, the check for CTDB_BASE being inconsistent with
node_dir is temporary.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-09 07:08:25 +01:00
Martin Schwenke
2b38b82303 ctdb-tests: Use setup_ctdb_base() for onnode unit tests
The nodes file is now in the CTDB_BASE directory so no CTDB_NODES_FILE
variable is needed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-09 07:08:25 +01:00
Martin Schwenke
258e1e04ae ctdb-tests: Use setup_ctdb_base() for eventscript unit tests
There is currently a directory of symlinks that are copied during test
setup.  These symlinks are updated during installation so they point
to the right place when copied.

Instead, use setup_ctdb_base() during test setup.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-09 07:08:25 +01:00
Amitay Isaacs
426e4a5a20 ctdb-pmda: Use modified API in pcp library 4.0
Support backward compatibility by checking for __pmID_int type, which
was previously in <pcp/impl.h>.  In the new version, this type is not
defined anymore and there is no need to include <pcp/impl.h>.

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): Fri Mar  2 00:38:52 CET 2018 on sn-devel-144
2018-03-02 00:38:52 +01:00
Martin Schwenke
ca315203be ctdb-common: Drop debugging variable CTDB_EXTERNAL_TRACE
This was an attempt to debug an unexpected situation.  It never
triggered, so delete it and all supporting code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-01 19:39:15 +01:00
Martin Schwenke
e17d02d403 ctdb-tests: Only use socket-wrapper for simple, local daemon tests
The run_tests.sh -S option now takes the path to the socker-wrapper
shared library.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-01-24 05:49:55 +01:00
Günther Deschner
ee0be7eb72 build: deal with recent glibc sunrpc header removal
We need to rely on libtirpc or libntirpc to be around in that case.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10976

Guenther

Pair-Programmed-With: Andreas Schneider <asn@samba.org>

Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-01-22 12:26:20 +01:00
Amitay Isaacs
495cc4ed22 ctdb-build: Apply dependency to correct subsystem
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-12-13 08:48:18 +01:00
Andreas Schneider
22bf36c85a build: Move socket_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-25 10:14:13 +01:00
Amitay Isaacs
046427b0ab ctdb-tests: Add interactive test for tunnels
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): Tue Oct 10 15:50:04 CEST 2017 on sn-devel-144
2017-10-10 15:50:04 +02:00
Amitay Isaacs
79a44d15bb ctdb-tests: Add test for tunnels
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-10-10 11:45:19 +02:00
Amitay Isaacs
ad1a9176d1 ctdb-client: Add client api for using tunnels
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-10-10 11:45:19 +02:00
Amitay Isaacs
c700464d23 ctdb-protocol: Add protocol marshalling for CTDB_REQ_TUNNEL
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-10-10 11:45:19 +02:00
Amitay Isaacs
9c51535775 ctdb-daemon: Add implementation of tunnel controls
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-10-10 11:45:18 +02:00
Martin Schwenke
c98691c340 ctdb-common: Replace parse_ip() -> ctdb_sock_addr_from_string()
... and ctdb_sock_addr_set_port().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-10-05 05:19:21 +02:00
Volker Lendecke
e12ed08bd5 ctdb: Centralize ctdb_version_string
Whenever the current git hash changes, we recompile ctdb.c and
ctdb_daemon.c. As both have quite a few warnings with -Wall, this
makes it quite difficult to see the real warnings that pop up during
development. Centralize the ctdb_version_string to just a single file
without warnings.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-09-26 09:37:13 +02:00
Martin Schwenke
3783b66fb3 ctdb-build: Split protocol-util as a separate subsystem
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-09-19 13:30:26 +02:00
Martin Schwenke
2550a88e2f ctdb-build: Fix dependency for ctdbd
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-09-19 13:30:26 +02:00
Amitay Isaacs
3067db5b50 ctdb-tests: Add a dummy ctdb client for testing
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13012

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-09-09 10:53:10 +02:00
Amitay Isaacs
dcc1eaf542 ctdb-common: Add sock_client abstraction
This sets up boilerplate required for a client code connecting to a
server over unix domain socket.  The communication between client
and server is "request" from client to server and "reply" from
server to client.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-09-01 08:52:07 +02:00
Amitay Isaacs
1787a4b632 ctdb-protocol: Add a generic packet header
This will avoid duplication when new daemons (and new client-server
protocols) are created out of the main ctdb daemon.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-09-01 08:52:07 +02:00
Amitay Isaacs
f02a1a1149 ctdb-protocol: Add marshalling for ctdb_req_keepalive
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-08-30 14:59:26 +02:00
Amitay Isaacs
b0ce8183ba ctdb-tests: Add compatibility test for ctdb protocol elements
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-08-30 14:59:25 +02:00
Amitay Isaacs
82b7ec031d ctdb-tests: Add compatibility test for protocol data types
This patch prepares for testing old and new marshalling codes for
various data types to ensure backward compatibility.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-08-30 14:59:22 +02:00
Amitay Isaacs
936fc23e3c ctdb-tests: Reorganize protocol tests
This patch splits the protocol tests from:
  protocol_types_test.c
  protocol_client_test.c

and creates the following files:

  protocol_common.[ch]       - common code for data types
  protocol_common_ctdb.[ch]  - common code for ctdb protocol elements
  protocol_common_event.[ch] - common code for eventd protocol elements
  protocol_basic_test.c      - basic data types
  protocol_types_test.c      - ctdb data types
  protocol_ctdb_test.c       - ctdb protocol
  protocol_event_test.c      - eventd protocol

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-08-30 14:59:21 +02:00
Amitay Isaacs
73748776d9 ctdb-protocol: Separate marshalling for basic data types
This splits protocol_types.c and creates new protocol_basic.c.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-08-30 14:59:21 +02:00
Martin Schwenke
ac1b1d8c8a ctdb-tests: run_tests.sh sets evironment variable CTDB_TEST_DIR
Instead of just local variable test_dir.  The environment variable can
be accessed from other test infrastructure scripts.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-08-14 05:15:25 +02:00
Amitay Isaacs
98ee7e7991 ctdb-common: Add run_event abstraction
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-05-30 03:58:06 +02:00
Amitay Isaacs
f1ad7d075a ctdb-build: Simplify generation of version header files
Generate version headers from waf instead of separate shell script.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-05-24 17:03:28 +02:00
Amitay Isaacs
1b2c919f19 ctdb-common: Add hash_count abstraction
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-04-05 04:47:23 +02:00
Ian Stakenvicius
9a9e3423d8 waf: disable-python - fix ctdb configuration
When ctdb is built in standalone mode, it turned off the python
requirement for submodules by setting Options.options.disable_python
to True before checking for its own (non-optional) python support.

Ad ctdb does not need python for itself or any of the submodules
it is built against, the safest solution seems to be to allow
the python and python-headers checks to not find python.

Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2017-03-10 07:31:12 +01:00
Martin Schwenke
7dbc5bbd60 ctdb-build: Fix RPM build
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12595

It doesn't look like recursion works for appending scripting commands.
Unroll the recursion instead.

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): Mon Feb 27 03:09:27 CET 2017 on sn-devel-144
2017-02-27 03:09:27 +01:00
Amitay Isaacs
5005362122 ctdb-build: Split dist() target to generate manpages separately
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12595

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-02-23 15:31:08 +01:00
Volker Lendecke
02380ca3e7 ctdb: Only build test_mutex_raw.c on Linux
This is pretty glibc on Linux specific. FreeBSD 11 also has
robust mutexes and can't build this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-02-15 02:28:16 +01:00
Amitay Isaacs
ce9b72c17a ctdb-build: Install CTDB tests correctly from toplevel
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12547

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): Thu Feb  2 08:25:57 CET 2017 on sn-devel-144
2017-02-02 08:25:57 +01:00
Amitay Isaacs
08b4a5f9f1 ctdb-tests: Do not build mutex test if robust mutexes are not supported
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-01-31 08:08:14 +01:00
Amitay Isaacs
7794497bc9 ctdb-tests: Add robust mutex test
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469

This demonstrates robust mutex bug on linux/glibc system.

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): Thu Jan 12 07:59:34 CET 2017 on sn-devel-144
2017-01-12 07:59:33 +01:00
Amitay Isaacs
3a56a16b06 ctdb-locking: Explicitly unlock record/db in lock helper
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469

Instead of killing lock helper processes with SIGKILL, send SIGTERM so
lock helper processes can explicitly unlock record/db.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-01-12 04:12:23 +01:00
Amitay Isaacs
1dc1689e74 ctdb-tests: Add tests for generic socket I/O
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12500

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-01-06 08:37:28 +01:00
Martin Schwenke
89b4920539 ctdb-tests: Add tests for takeover helper
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-19 04:07:08 +01:00
Martin Schwenke
8d9b41d427 ctdb-takeover: Add takeover helper
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-19 04:07:08 +01:00
Martin Schwenke
b993771ab0 ctdb-tests: Add public IP state to fake_ctdbd
Read it via a PUBLICIPS section.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-19 04:07:07 +01:00
Martin Schwenke
16abc2071b ctdb-tests: Factor out reading of known public IP addresses
One change in behaviour is to actually copy the known IPs per node
instead of just assigning the pointer.  When this is used by
fake_ctdbd the resulting structure will be used to keep state for
individual nodes, so data for nodes needs to be independent.

Also, drop some asserts in the factored code and do (slightly) better
error handling.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-19 04:07:07 +01:00
Amitay Isaacs
fc28a74254 ctdb-daemon: Remove ctdb_event_helper
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): Sun Dec 18 18:10:50 CET 2016 on sn-devel-144
2016-12-18 18:10:50 +01:00
Amitay Isaacs
ca0894e932 ctdb-tests: Add tests for event daemon
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-18 14:23:23 +01:00
Amitay Isaacs
9cbdb40612 ctdb-tool: Add helper for talking to event daemon
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-18 14:23:23 +01:00
Amitay Isaacs
b678dfb3a4 ctdb-client: Add client api for eventd communication
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-18 14:23:23 +01:00
Amitay Isaacs
950110f3c1 ctdb-eventd: Add event script handling daemon
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-18 14:23:22 +01:00
Amitay Isaacs
7e8ccef49b ctdb-protocol: Add marshalling for eventd protocol
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-18 14:23:22 +01:00
Amitay Isaacs
7ae530c2ab ctdb-common: Add sock_daemon abstraction
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-18 14:23:22 +01:00
Amitay Isaacs
75a25d1331 ctdb-common: Add generic socket I/O
This is a generic socket read/write to be used in the ctdb daemon.
It is based on ctdb_io.c and comm.c.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-18 14:23:22 +01:00
Amitay Isaacs
f0ba41e1c5 ctdb-common: Add run_proc abstraction
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-18 14:23:22 +01:00
Martin Schwenke
3845ff6349 ctdb-tests: Add unit test for protocol utilities
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12470

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-16 08:42:32 +01:00
Amitay Isaacs
15d5ed7bb7 ctdb-build: Remove unnecessary intermediate build target
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-16 08:42:32 +01:00
David Disseldorp
8aba284fc4 ctdb/doc: man page for Ceph RADOS cluster mutex helper
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-09 04:10:20 +01:00
David Disseldorp
d8b61863ec ctdb: cluster mutex helper using Ceph RADOS
ctdb_mutex_ceph_rados_helper implements the cluster mutex helper API
atop Ceph using the librados rados_lock_exclusive()/rados_unlock()
functionality.

Once configured, split brain avoidance during CTDB recovery will be
handled using locks against an object located in a Ceph RADOS pool.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-09 04:10:20 +01:00
David Disseldorp
cbc81dd78e ctdb-build: configure time switch for etcd support
Disable generation/installation of the etcd cluster mutex helper by
default. Support can be explicitly enabled at configure time with
--enable-etcd-reclock.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-09 04:10:20 +01:00
David Disseldorp
832711718e ctdb-build: move ctdb_etcd_lock to utils/etcd
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-09 04:10:20 +01:00
Amitay Isaacs
c7c2f15883 ctdb-build: Generate pre-built documentation in wscript itself
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2016-12-09 04:10:20 +01:00
Amitay Isaacs
27bd4c9eeb ctdb-build: Avoid duplicate list of man pages
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2016-12-09 04:10:20 +01:00
Jose A. Rivera
4e32944b78 ctdb: Add new helper ctdb_etcd_lock
This introduces a mutex helper called ctdb_etcd_lock, which allows CTDB to
use an existing etcd cluster to provide the functionality of a recovery lock
using the API outlined in ctdb/doc/cluster_mutex_helper.txt.

Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): José A. Rivera <jarrpa@samba.org>
Autobuild-Date(master): Mon Dec  5 19:39:10 CET 2016 on sn-devel-144
2016-12-05 19:39:10 +01:00
Amitay Isaacs
02aa65cede ctdb-logging: Remove duplicate logging code
ctdb_logging_init() now uses logging_init().

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-05 08:09:22 +01:00
Amitay Isaacs
c9124a001f ctdb-logging: Refactor logging code
This extracts the code from following files:
  - server/ctdb_logging.c
  - server/ctdb_logging_file.c
  - server/ctdb_logging_syslog.c

This is in preparation for each daemon (and some processes) doing
their own loging instead of relying on CTDB.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-05 08:09:22 +01:00
Martin Schwenke
bdc049dfce ctdb-common: Drop CTDB's copy of sys_read() and sys_write()
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): Tue Nov 29 11:22:40 CET 2016 on sn-devel-144
2016-11-29 11:22:40 +01:00
Amitay Isaacs
2a9584dc0a ctdb-daemon: Remove unused code cmdline.[ch]
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-11-25 04:19:23 +01:00
Martin Schwenke
fd8e562069 ctdb-packaging: Move CTDB tests to /usr/local/share/ctdb/tests/
In time, other things will end up in /use/local/share/ctdb/.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12104

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-10-14 08:07:11 +02:00
Amitay Isaacs
97b6ac7f66 ctdb-common: Add routines to manage PID file
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12287

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-09-22 08:34:20 +02:00
Andreas Schneider
f9c85d04e9 ctdb-waf: Move ctdb tests to libexec directory
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12104

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-08-04 18:26:07 +02:00
Amitay Isaacs
70f2573f2a ctdb-tool: Add replacement ctdb tool using new client API
New tool breaks some of the tool unit tests due to improved error
messages.  Those changes are in the following patch.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-28 05:00:17 +02:00
Amitay Isaacs
199293f4a1 ctdb-tool: Remove old ctdb tool
Removing and adding replacement code makes the commits cleaner.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-28 05:00:17 +02:00
Martin Schwenke
337fc6e2e7 ctdb-doc: Integrate ctdb_diagnostics man page into build
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-28 05:00:15 +02:00
Amitay Isaacs
f79be2ee4c ctdb-common: Refactor tunable related functions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-25 21:29:46 +02:00
Amitay Isaacs
fbce266c23 ctdb-build: Add missing dependency on samba-util
reqid.c uses idr, which requires samba-util.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-25 21:29:43 +02:00
Amitay Isaacs
6bd0f1cf46 ctdb-pcp-pmda: Reimplement using new client API
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): Fri Jul 22 10:31:57 CEST 2016 on sn-devel-144
2016-07-22 10:31:56 +02:00
Amitay Isaacs
3619a76144 ctdb-tests: Add torture test for fetch functions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
b8b6829e2a ctdb-tests: Remove unused tests code
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
6ad8f4630b ctdb-tests: Rename ctdb_porting_tests to porting_tests
and create unit test for it.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
7ab560527c ctdb-tests: Rename ctdb_lock_tdb to lock_tdb
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
e98f7c264b ctdb-tests: Convert rb_test into a unit test
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
a76fa36c2a ctdb-tests: Replace ctdb_update_record_persistent with update_record_persistent
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
f6d4f4d9f9 ctdb-tests: Replace ctdb_update_record with update_record using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
8cc069bd06 ctdb-tests: Replace ctdb_transaction with transaction_loop using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
c2e406c7fe ctdb-tests: Replace ctdb_fetch_readonly_loop with fetch_readonly_loop using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
5a510ecbea ctdb-tests: Replace ctdb_fetch_readonly_once with fetch_readonly using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
bc157dc3d4 ctdb-tests: Replace ctdb_fetch_one with fetch_loop using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
2c27f3002f ctdb-tests: Replace ctdb_fetch with fetch_ring using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
388fa2c9b8 ctdb-tests: Replace ctdb_bench with message_ring using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
5fe216aa3e ctdb-tests: Add torture test for g_lock functions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
f0395deb17 ctdb-tests: Common code to process commandline options
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
47d95d2a0b ctdb-tests: Common code to wait for synchronization across cluster
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Martin Schwenke
e0aae9f0d3 ctdb-tests: Add shellcheck test suite
CTDB has a lot of scripts and shellcheck can be useful to find dubious
scripting practices.

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 Jul 21 06:06:49 CEST 2016 on sn-devel-144
2016-07-21 06:06:49 +02:00
Martin Schwenke
b51f604f75 ctdb-tests: Add new test support script for script install paths
This helps unit tests locate CTDB's scripts.  It is being created to
support some new shellcheck unit tests.

Hopefully, it can also be used to simplify some of the symlink
complexity in some other unit tests suites, such as eventscripts.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:27 +02:00
Michael Adam
2f95ada149 ctdb: fix autotest with socket-wrapper installed in the system
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Jul 11 15:53:30 CEST 2016 on sn-devel-144
2016-07-11 15:53:30 +02:00
Amitay Isaacs
c9d61dbbfb ctdb-build: Exit if requested feature cannot be built
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): Tue Jul  5 14:38:30 CEST 2016 on sn-devel-144
2016-07-05 14:38:28 +02:00
Martin Schwenke
5a0d1b7cc5 ctdb-tests: Link to ctdb-ipalloc instead of using ctdbd_test.c
Less code, quicker build time, smaller binary...

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): Mon Jul  4 19:29:08 CEST 2016 on sn-devel-144
2016-07-04 19:29:08 +02:00
Michael Adam
1cc5f8f616 ctdb: set the path to 'ctdb' in 'functions' in CTDB
Allow this to be overridden from the caller.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-06-11 06:20:13 +02:00
Amitay Isaacs
e1e14420a6 ctdb-tests: Re-use set_blocking instead of re-definition
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-06-08 10:33:19 +02:00
Amitay Isaacs
3031732504 ctdb-tests: Re-use async accept wrapper from async_req
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-06-08 10:33:19 +02:00
Amitay Isaacs
2082c0c3b5 lib/util: Avoid splitting tevent-unix-util as public library
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11946

Commit 670db6ac1d split tevent-util public
library to create tevent-unix-util public library for standalone ctdb
use.  This created a public library dependency between samba and ctdb
for packaging.

Bundle tevent_unix.c in public library tevent-util as before.  However,
to avoid the dependencies for packaging, standalone ctdb build will
build tevent-util as a private library with only tevent_unix.c

This simplifies any new subsystems (or libraries) which need tevent-util
and are linked in both samba and ctdb.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-06-06 12:26:19 +02:00
Amitay Isaacs
90f04c7fc3 ctdb-tests: Remove ctdb tool stub code
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-05-10 22:51:23 +02:00