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

7827 Commits

Author SHA1 Message Date
Martin Schwenke
7e9dd3fd3c ctdb-tests: Ensure notify.sh is available to local daemons
Changes to notification configuration are coming, so ensure notify.sh
is always "installed" for local daemons.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-01 13:31:18 +02:00
Martin Schwenke
ed80fc1344 ctdb-daemon: Provide a default location for the notification script
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-01 13:31:18 +02:00
Martin Schwenke
518be6d5a2 ctdb-daemon: Use a local variable instead of repeating getenv()
Makes the error handling easier and the code more compact.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-01 13:31:18 +02:00
Martin Schwenke
7052f87903 ctdb-daemon: Drop unused function ctdb_set_notification_script()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-01 13:31:18 +02:00
Martin Schwenke
17ad7d9114 ctdb-daemon: Set ctdb->notification_script directly
This doesn't need a wrapper function.  It gets in the way if building
a value involves allocating memory (e.g. talloc_asprintf()) and then
ctdb_set_notification_script() duplicates that memory.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-01 13:31:18 +02:00
Martin Schwenke
f5ee088420 ctdb-docs: Move some configuration options out of the debug section
These aren't test options so improve their visibility.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-01 13:31:18 +02:00
Martin Schwenke
cdd51df35f ctdb-docs: Move some ctdbd options out of the debug section
ctdbd -i might be useful with systemd or similar, so should be
documented.

--nosetsched and --script-log-level options are valid user-level
options.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-01 13:31:18 +02:00
Amitay Isaacs
b3dc0dca47 ctdb-build: Rename ctdb-client2 subsystem to ctdb-client
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-05-01 13:31:17 +02:00
Amitay Isaacs
e70fe41949 ctdb-daemon: Move ctdb_client.c to server/ subdir
It is used only by the code in the server directory.  It's mainly used
in recovery daemon and vacuuming child process.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-05-01 13:31:17 +02:00
Amitay Isaacs
45202d86c5 ctdb-build: Drop unnessary dependency on ctdb-client
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-05-01 13:31:17 +02:00
Amitay Isaacs
01c8dc7e15 ctdb-client: Remove ununsed functions from old client code
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13411

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-05-01 13:31:17 +02:00
Martin Schwenke
a23d805475 ctdb-tests: Fix a typo
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 Apr 30 14:26:43 CEST 2018 on sn-devel-144
2018-04-30 14:26:43 +02:00
Martin Schwenke
693ca7b99e ctdb-tests: Simplify a test
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-04-30 11:41:22 +02:00
Martin Schwenke
110e72ccd8 ctdb-scripts: Drop CTDB_RC_LOCAL testing hook
This is not used.

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): Fri Apr 27 09:37:49 CEST 2018 on sn-devel-144
2018-04-27 09:37:48 +02:00
Martin Schwenke
26430ab1d1 ctdb-scripts: Drop unused variable service_config
This was previously used by the loadconfig() function.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-04-27 06:53:16 +02:00
Martin Schwenke
dbc6ebc624 ctdb-docs: Drop documentation for CTDB_SHUTDOWN_TIMEOUT option
This was recently removed but the documentation was forgotten.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-04-27 06:53:16 +02:00
Martin Schwenke
072650b40e ctdb-docs: Drop stale reference to unused configuration file
Recently removed but documentation change was forgotten.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-04-27 06:53:16 +02:00
Martin Schwenke
3388aed012 ctdb-docs: Drop references to CTDB_BASE from the documentation
CTDB_BASE should only ever be modified by test code.  It should not be
mentioned in the user documentation.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-04-27 06:53:16 +02:00
Martin Schwenke
d44fed601d ctdb-tools: Avoid filtering stderr when onnode not running in parallel
stderr_filter() only does anything useful when running in
parallel (i.e. with the -p option).  So, simplify the non-parallel
case by not using stderr_filter().

As a side-effect, this fixes an issue introduced in commit
85a4375788 where local daemon tests
would hang when trying to start daemons with VALGRIND set (to a
valgrind command that does not use --log-file).  This is because
valgrind would keep stderr open for its output so the pipeline
involving stderr_filter() would never complete.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-04-27 06:53:16 +02:00
Martin Schwenke
d8741feec5 ctdb-scripts: Avoid shellcheck SC1117: Backslash is literal in "..."
This warning (apparently new in shellcheck 0.4.7) only applies to
double-quoted strings.  Change affected constant strings to use
single-quotes.  In the one example that contains a variable expansion
escape the backslash as recommended.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-04-27 06:53:16 +02:00
Martin Schwenke
7dbf833697 ctdb: Fix some -Werror=strict-overflow issues
All quite obvious.  For the LCP2 one, we're not actually counting so
use a bool instead of an int.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-04-27 06:53:16 +02:00
Swen Schillig
b8f7f42565 ctdb: Remove double sanity checks from ctdb_tcp_read_cb
Within ctdb_tcp_read_cb the provided data is checked for sanity,
e.g. correct size and content. This is not required because it was
done already by the caller(queue_process).

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Apr  4 09:31:04 CEST 2018 on sn-devel-144
2018-04-04 09:31:04 +02:00
Swen Schillig
c42c721b98 ctdb: Remove double sanity checks from ctdb_daemon_read_cb
Within ctdb_daemon_read_cb the provided data is checked for sanity,
e.g. correct size and content. This is not required because it was
done already by the caller (queue_process).

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-04-04 06:35:17 +02:00
Amitay Isaacs
6b75d2c650 ctdb-scripts: Drop "net serverid wipe" from 50.samba event script
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13359

There is no serverid database anymore.

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

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Mar 31 08:34:00 CEST 2018 on sn-devel-144
2018-03-31 08:34:00 +02:00
Swen Schillig
e8dba1908b ctdb-server: Only set destructor if required
Set the detructor in ctdb_start_revoke_ro_record after the revokechild_handle
was added to the list.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Mar 31 03:45:51 CEST 2018 on sn-devel-144
2018-03-31 03:45:51 +02:00
Swen Schillig
134223e4db ctdb-server: Add goto tag avoiding code duplication
Introduced err_out goto tag to prevent code duplication.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-31 00:07:18 +02:00
Swen Schillig
7248b82e56 ctdb-server: Minor code cleanup
Cleanup ctdb_start_revoke_ro_record to improve readability.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-31 00:07:18 +02:00
Swen Schillig
423d7e2460 ctdb-server: Replace the variable rc by something meaningful
Replace the varibale name "rc" in ctdb_start_revoke_ro_record
to prevent a mix-up with the common meaning of rc (return code).

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-31 00:07:18 +02:00
Swen Schillig
b40bcb094d ctdb-server: Only talloc_set_destructor when required
The destructor is only needed once the state got added to the DLIST.
Therefore, move the setting of the destructor to after the addition
of state to the DLIST.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-31 00:07:18 +02:00
Swen Schillig
3269cd6707 ctdb-server: Cleanup ctdb_daemon_call_send_remote
Minor code cleanup and adding a temporary variable to improve readabilty.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-31 00:07:18 +02:00
Swen Schillig
a2f2bf9e97 ctdb: Use talloc_zero instead of zeroing attributes
Zero entire structure with talloc_zero on memory allocation instead of
setting each attribute individually.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-31 00:07:18 +02:00
Swen Schillig
d6a9dc6e24 ctdb: Use provided mem_ctx for newly allocated memory
ctdb_call_local is called with a mem_ctx parameter which should be used
for newly allocated memory.

This is safe because all allocations of this context are freed before
this function returns.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-31 00:07:18 +02:00
Swen Schillig
aba3d50802 ctdb: Fixing possible memory leak in ctdb_tcp_read_cb
In case of an error condition the further processing of the data is cancelled
and the callback returns. In such a scenario the data has to be free'd.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-31 00:07:18 +02:00
Swen Schillig
611c9a0ba9 ctdb: Fixing memory leak in ctdb_tcp_tnode_cb
It is expected by the caller(queue_process) that the callback is
free'ing the memory referenced by the data pointer.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-31 00:07:18 +02:00
Swen Schillig
22299f9898 ctdb: Fixing possible memory leak in ctdb_daemon_read_cb
In case of an error condition the further processing of the data is cancelled
and the callback returns. In such a scenario the data has to be free'd.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-31 00:07:18 +02:00
Martin Schwenke
4e0cf2fa76 ctdb-tests: Delete unused fake /etc/sysconfig/ctdb file
The only remaining item is a setting of CTDB_DEBUGLEVEL, which is not
required.

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 Mar 28 07:27:58 CEST 2018 on sn-devel-144
2018-03-28 07:27:58 +02:00
Martin Schwenke
02fc52d69b ctdb-scripts: Tunables are now loaded from ctdb.tunables
Using CTDB_SET_TunableVariables in the main configuration file is no
longer supported.

The only subtlety is an unexpected order change in one of the unit
test results.  This is because the old implementation implicitly
sorted the tunable variables via the set command.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:21 +02:00
Martin Schwenke
1db96ce26e ctdb-tests: Rename setup_config() to setup_tunable_config()
Drop the "CTDB_SET_" prefix from variable names and add it back for
now.  When there is a better way of setting tunables then this
function will support that.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:21 +02:00
Martin Schwenke
66cfddc61c ctdb-tests: Script options into per-script file
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:21 +02:00
Martin Schwenke
65ce5e2129 ctdb-scripts: Use load_script_options in event scripts
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:21 +02:00
Martin Schwenke
a2f8730c75 ctdb-scripts: Add new function load_script_options()
For now this loads the global CTDB configuration too.  This will
change in the future after things are properly modularised.

This also anticipates a future change where event scripts end with a
".script" suffix.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:21 +02:00
Martin Schwenke
e0c2b3a1e1 ctdb-tests: Use setup_script_options() in 91.lvs tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:21 +02:00
Martin Schwenke
a48bd34246 ctdb-tests: Use setup_script_options() in 60.nfs (and 06.nfs) tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
96ed6c34ba ctdb-tests: Use setup_script_options() in 50.samba tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
ecda38c894 ctdb-tests: Use setup_script_options() in 49.winbind tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
3944fc4ae3 ctdb-tests: Use setup_script_options() in 41.httpd tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
17b8f12d1c ctdb-tests: Use setup_script_options() in 40.vsftpd tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
051458feb0 ctdb-tests: Use setup_script_options() in 31.clamd tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
a16eb657d1 ctdb-tests: Use setup_script_options() in 20.multipathd tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
ef98333d6a ctdb-tests: Use setup_script_options() in 13.per_ip_routing tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
6b88a8188b ctdb-tests: Use setup_script_options() in 11.natgw tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
87cd76e0c6 ctdb-tests: Use setup_script_options() in 10.interface tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
45de2b1d9b ctdb-tests: Use setup_script_options() in 05.system tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
3712640d47 ctdb-tests: New function setup_script_options()
Currently exports the variable assignment on each line.  Later this
can be changed to handle actual per-script configuration.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
b499775527 ctdb-scripts: Split CTDB configuration loading
loadconfig() currently tries to load the CTDB configuration and also
any system configuration relevant to the current (event) script.

Instead add a new function load_system_config() to load the
distribution-specific system configuration for a component.  Call this
directly in the rare scripts that need the system configuration.

Also call load_system_config when loading the CTDB configuration to
pull in anything from the CTDB system configuration.  This is partly
for backward compatibility but also to get options that can be used
anywhere.

loadconfig() no longer takes an argument.  It simply loads the CTDB
configuration.

Drop support for falling back to /etc/ctdb/sysconfig/ctdb (or
similar).  Surely there's nobody who uses that!

Also, drop the indirection where loadconfig() calls _loadconfig().
This was used years ago as a test hook and is no longer required.

Inexplicably, this change introduces a new shellcheck test failure, so
silence this.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
8b18221529 ctdb-docs: Promote CTDB_INIT_STYLE to global options section
Clarify that the global options should be set in the system
configuration file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:20 +02:00
Martin Schwenke
1c9b6c3992 ctdb-scripts: Clean up function detect_init_style()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
6c5f7c0003 ctdb-tests: Remove unused functions and stubs
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
58db0dbeda ctdb-tests: statd-callout script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
8ee51d2f2d ctdb-tests: 91.lvs event script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
042a5101fc ctdb-tests: 60.nfs (and 06.nfs) event script setup modularisation
Includes gratuitous changes to get lines below 80 columns.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
ab5bc195c4 ctdb-tests: 50.samba event script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
34eba35c61 ctdb-tests: 49.winbind event script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
29eb410f26 ctdb-tests: 41.httpd event script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
99c3fd3460 ctdb-tests: 40.vsftpd event script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
3172dc7244 ctdb-tests: 31.clamd event script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
0bc1b4b27e ctdb-tests: 20.multipathd event script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
0ca1cfcf61 ctdb-tests: 13.per_ip_routing event script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
a63c456080 ctdb-tests: 11.natgw event script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
8c81fb9d9a ctdb-tests: 10.interface event script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:19 +02:00
Martin Schwenke
d8232476ed ctdb-tests: 05.system event script setup modularisation
Do initial test setup using setup() function.  Rename usage setting
functions to make them more obvious.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
7cddc88d03 ctdb-tests: 01.reclock event script setup modularisation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
db5c604152 ctdb-tests: 00.ctdb testing setup modularisation
Switch to generic setup() function and set variables there.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
5815c32d01 ctdb-tests: Define generic setup() function
Create default setup() function that aborts.  This function will be
redefined by each support script and used to do the setup.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
9038759259 ctdb-tests: statd-callout.sh simple 80 column fixups
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
44b29982f4 ctdb-tests: 60.nfs.sh simple 80 column fixups and reordering
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
b526968bcf ctdb-tests: 20.multipathd.sh 80 column fixups
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
4430e22d0c ctdb-tests: 11.natgw.sh simple 80 column fixups
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
bfd2d70fc4 ctdb-tests: 10.interface.sh simple 80 column fixups
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
b6cde6ff9f ctdb-tests: 05.system.sh simple 80 column fixups
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
0f78e0b4c4 ctdb-tests: Create statd-callout.sh
Contains testing support used only by tests for statd-callout script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
0f080cebef ctdb-tests: Create 91.lvs.sh
Contains testing support used only by tests for 91.lvs event scripts.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
7d91de549b ctdb-tests: Create 60.nfs.sh and 06.nfs.sh
Contains testing support used only by tests for 60.nfs and 06.nfs
event scripts.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
32d8483b07 ctdb-tests: Create 50.samba.sh
Contains testing support used only by tests for 50.samba event script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:18 +02:00
Martin Schwenke
a51e4ea042 ctdb-tests: Create 49.winbind.sh
Contains testing support used only by tests for 49.winbind event
script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
f33f4b3a23 ctdb-tests: Create 41.httpd.sh
Contains testing support used only by tests for 41.httpd event script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
f306c2d807 ctdb-tests: Create 40.vsftpd.sh
Contains testing support used only by tests for 40.vsftpd event
script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
38b54a60f5 ctdb-tests: Create 20.multipathd.sh
Contains testing support used only by tests for 20.multipathd event
script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
e489929335 ctdb-tests: Create 13.per_ip_routing.sh
Contains testing support used only by tests for 13.per_ip_routing
event script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
916b7f947e ctdb-tests: Create 11.natgw.sh
Contains testing support used only by tests for 11.natgw event script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
ee6052e689 ctdb-tests: Create 10.interface.sh
Contains testing support used only by tests for 10.interface event
script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
f5a70415dd ctdb-tests: Create 05.system.sh
Contains testing support used only by tests for 05.system event script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
7b4dd7e539 ctdb-tests: Create 01.reclock.sh
Contains testing support used only by tests for 01.reclock event
script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
bcb6cc2861 ctdb-tests: Create 00.ctdb.sh
Contains testing support used only by tests for 00.ctdb event script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
bbd96993c8 ctdb-tests: Allow modularisation of event script testing support
local.sh is enormous.  Allow per-event-script customisation.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
26e090dd4e ctdb-tests: Clean up handling of CTDB_SCRIPT_VARDIR
Only set this in ctdb_set_pnn() and always use the PNN in the path.

Generic setup functions like setup_ctdb() will go away soon in favour
of more doing setup that is specific to the script being tested.
Therefore, call ctdb_set_pnn() in define_test() to ensure that
CTDB_SCRIPT_VARDIR is always set.  Note that setup_ctdb() is never
called with an argument so the default PNN has always been 0.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
1d7d4874df ctdb-tests: Clean up fake share handling
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
3c82d3ae3d ctdb-tests: New function setup_numnodes()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:17 +02:00
Martin Schwenke
6eec33c0a7 ctdb-tests: Tweak debug function
Output to stderr.  Read from stdin if no arguments given, making it
possible to handle long lines using here documents.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
e4a4532e5c ctdb-tests: Make date handling consistent in 00.ctdb tests
This duplicates the filter function but that will be fixed later.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
3571345667 ctdb-tests: New support functions setup_dbdir() and setup_date()
For now, these need to be called from setup_generic() to stop tests
from breaking.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
ab89958817 ctdb-tests: Don't set FAKE_ETHTOOL_LINK_DOWN globally
This variable doesn't need to be set in a generic function and can be
set by the ethtool support functions

This is now a subdirectory of FAKE_NETWORK_STATE.

The down/up functions get reindented because the new 1st line should
be indented according to the new script indent-with-tabs style.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
26329aa035 ctdb-tests: Move variable FAKE_IP_STATE into the ip stub
It is the only user of this variable.

This is now a subdirectory of FAKE_NETWORK_STATE.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
3bbf3e97ca ctdb-tests: Move variable FAKE_CTDB_IFACES_DOWN into ctdb stub
It is the only user of this variable.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
ce1b5b30d3 ctdb-tests: Remove case statement in ctdb stub
This removes a lot of unnecessary clutter.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
713804beec ctdb-tests: Update argument handling of ctdb stub functions
All functions are now called after shifting away the command name.

There is less churn that expected because some functions don't use any
arguments.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
7d1d5fc969 ctdb-tests: Move ctdb stub code from case statement to functions
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
06be4a6529 ctdb-tests: Drop unused ctdb stub scriptstatus and xpnn commands
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
6f730c4b3a ctdb-tests: Fix a bug in the ctdb stub's moveip command
This was writing garbage into the IP layout file and relevant tests
were passing by luck.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
fb2090762e ctdb-tests: New global variable FAKE_NETWORK_STATE
Stash all the network state in this directory.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
ad081f9144 ctdb-tests: Make FAKE_CTDB_STATE globally set
Lots of things depend on it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:16 +02:00
Martin Schwenke
cf866d66aa ctdb-scripts: Drop unused functions
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:15 +02:00
Martin Schwenke
2f33b18d84 ctdb-script: Drop CTDB_MANAGED_SERVICES configuration option
This seems never to have caught on so reduce complexity.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:15 +02:00
Martin Schwenke
ce5116cfb3 ctdb-tests: Don't expand octal escapes in unit test output
The echo command in dash expands octal escapes in strings by default
but the echo command in bash doesn't.  Since the behaviour is
ill-defined, use printf to handle affected strings.  However, ensure
that these strings aren't used as format strings.

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 Mar 27 09:06:14 CEST 2018 on sn-devel-144
2018-03-27 09:06:14 +02:00
Amitay Isaacs
7da9802acd ctdb-tests: Add debug messages for unimplemented functions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
c86565885d ctdb-tests: Add database traverse tests
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
a5fb33e277 ctdb-tests: Implement traverse control in fake_ctdbd
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
2a8e425767 ctdb-tests: Add persistent database tests
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
8250956c92 ctdb-tests: Implement transaction control in fake_ctdbd
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
7c30d4791d ctdb-tests: Add volatile database tests
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
5be29b792d ctdb-tests: Add req_call processing in fake_ctdbd
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
0e5e846926 ctdb-tests: Use seqnum from tdb if available in fake_ctdbd
This also adds the lower level ltdb read/write functions required to
read seqnum from database.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
14bdbef9c1 ctdb-tests: Add database attach tests
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
50e25418e0 ctdb-tests: Implement database attach control in fake_ctdbd
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
2de660722d ctdb-tests: Add dbdir option for creating databases in fake_ctdbd
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
147ff850aa ctdb-tests: Convert database map to a linked list in fake_ctdbd
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
4e37be92bf ctdb-client: Add missing initialization of tevent_context
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13356

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
92a68af1a8 ctdb-client: Do not try to allocate 0 sized record
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13356

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-03-27 04:27:24 +02:00
Martin Schwenke
3451a03611 ctdb-scripts: Drop CTDBD_CONF internal test variable
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 Mar 19 07:32:22 CET 2018 on sn-devel-144
2018-03-19 07:32:22 +01:00
Martin Schwenke
02a942ea47 ctdb-tests: Drop unused functions
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:20 +01:00
Martin Schwenke
1d7f86a8cd ctdb-tests: Construct values for CTDB_BASES by hand
setup_ctdb_base() and node_dir() duplicate the construction of
CTDB_BASE.  Drop the use of node_dir() and construct the values for
CTDB_BASES by hand.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:20 +01:00
Martin Schwenke
ebd2589087 ctdb-tests: Use CTDB_BASE instead of node_dir
Simple test configuration is all relative to CTDB_BASE and node_dir is
redundant.  Make this explicit by dropping most uses of node_dir.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:20 +01:00
Martin Schwenke
85a4375788 ctdb-tests: Use onnode to start/stop local daemons
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:20 +01:00
Martin Schwenke
db7e4aa3d8 ctdb-daemon: Drop ctdbd --nlist option
Tests now deviate from the compile-time default by setting CTDB_BASE.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:20 +01:00
Martin Schwenke
dedc9eab92 ctdb-tools: No longer honour CTDB_NODES environment variable
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:20 +01:00
Martin Schwenke
6cf861a544 ctdb-scripts: Drop CTDB_NODES configuration option
Tests now deviate from the compile-time default by setting CTDB_BASE.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:20 +01:00
Martin Schwenke
a1eac09dd3 ctdb-tools: Drop testing hook from ctdb tool
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:20 +01:00
Martin Schwenke
480c586c7d ctdb-tests: Simplify nodes file handling in tool tests
Instead of using an intermediate environment variable for nodes files,
just create "node" or "nodes.<pnn>" in CTDB_BASE.  This makes the
nodes file loading in fake_ctdb slightly repetitive but simplifies the
test scripts a lot.  It also remove several instance of the CTDB_NODES
variable from the code base, so it is no longer found by "git grep".

Use an empty nodes file to indicate that fake_ctdbd should fail to
read it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:20 +01:00
Martin Schwenke
3a7c49dfbc ctdb-tests: Put configuration, socket and PID file in CTDB_BASE
setup_ctdb_base() makes this a convenient temporary directory.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00
Martin Schwenke
78248adad6 ctdb-tests: Improve setting of helper paths
Make use of variables provided by script_install_paths.sh instead of
reinventing the logic.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00
Martin Schwenke
10354438b8 ctdb-tests: Use setup_base() in tool unit tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00
Martin Schwenke
d55e7d8abc ctdb-tests: Drop an orphaned comment
The relevant code was removed long ago.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00
Martin Schwenke
16a93d7691 ctdb-tools: Drop onnode CTDB_NODES_FILE environment variable
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00
Martin Schwenke
c8c944d618 ctdb-tests: Use default location for nodes file
Create the file and then copy it to CTDB_BASE for each node.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00
Martin Schwenke
f6d6f2220b ctdb-daemon: Drop ctdbd --public-interface option
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00
Martin Schwenke
b1fcb0a129 ctdb-scripts: Drop CTDB_PUBLIC_INTERFACE configuration option
The interface must always be specified in the public addresses file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00
Martin Schwenke
482ff4bdd3 ctdb-daemon: Drop ctdbd --public-addresses option
Use the default location.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00
Martin Schwenke
346c28d070 ctdb-tests: Remove unused function get_ctdbd_command_line_option()
This was a bad idea.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00
Martin Schwenke
6ecddd4f72 ctdb-scripts: Drop CTDB_PUBLIC_ADDRESSES configuration option
This option adds a lot of unnecessary complexity to scripts.
Configuration should go in $CTDB_BASE, either directly or via a
symlink, so simplify by using the default location.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00
Martin Schwenke
b6127a6384 ctdb-tests: Allow tests access to CTDB_BASE
On the node where the tests are run, CTDB_BASE is always set.  This
applies to local daemons too.  However, when tests are being run
against a real cluster, there may be a need to access configuration
files.  However, CTDB_BASE will not be set in this case.

So, provide a function to get CTDB_BASE, if set, or a real cluster
node's configuration directory, if CTDB_BASE is not set.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19 02:23:19 +01:00