kai/samba-autobuild/.git
23 months agoctdb: Use talloc_zero instead of zeroing attributes
Swen Schillig [Wed, 21 Feb 2018 12:52:11 +0000 (13:52 +0100)]
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>
23 months agoctdb: Use provided mem_ctx for newly allocated memory
Swen Schillig [Wed, 21 Feb 2018 12:34:28 +0000 (13:34 +0100)]
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>
23 months agoctdb: Fixing possible memory leak in ctdb_tcp_read_cb
Swen Schillig [Tue, 13 Mar 2018 08:34:52 +0000 (09:34 +0100)]
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>
23 months agoctdb: Fixing memory leak in ctdb_tcp_tnode_cb
Swen Schillig [Tue, 13 Mar 2018 08:42:24 +0000 (09:42 +0100)]
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>
23 months agoctdb: Fixing possible memory leak in ctdb_daemon_read_cb
Swen Schillig [Tue, 13 Mar 2018 08:06:45 +0000 (09:06 +0100)]
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>
23 months agos4:torture: kernel oplocks. Fix assertion warning
Jones Syue [Fri, 30 Mar 2018 00:31:06 +0000 (08:31 +0800)]
s4:torture: kernel oplocks. Fix assertion warning

Simply boolean 'ret' instead of 'ret = true'.

Signed-off-by: Jones Syue <jonessyue@qnap.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Mar 30 18:39:19 CEST 2018 on sn-devel-144

2 years agos3:smbd: don't use the directory cache for SMB2/3
Ralph Boehme [Thu, 29 Mar 2018 18:06:47 +0000 (20:06 +0200)]
s3:smbd: don't use the directory cache for SMB2/3

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13363

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 30 03:51:48 CEST 2018 on sn-devel-144

2 years agos4: torture: Test all combinations of directory open with existing directory to ensur...
Jeremy Allison [Wed, 28 Mar 2018 20:19:12 +0000 (13:19 -0700)]
s4: torture: Test all combinations of directory open with existing directory to ensure behavior is the same.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 29 23:13:42 CEST 2018 on sn-devel-144

2 years agos4: torture: Test all combinations of directory create to ensure behavior is the...
Jeremy Allison [Wed, 28 Mar 2018 20:17:14 +0000 (13:17 -0700)]
s4: torture: Test all combinations of directory create to ensure behavior is the same.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2 years agos4: torture: Test all combinations of file open with existing file to ensure behavior...
Jeremy Allison [Wed, 28 Mar 2018 18:44:40 +0000 (11:44 -0700)]
s4: torture: Test all combinations of file open with existing file to ensure behavior is the same.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2 years agos4: torture: Test all combinations of file create to ensure behavior is the same.
Jeremy Allison [Wed, 28 Mar 2018 18:00:59 +0000 (11:00 -0700)]
s4: torture: Test all combinations of file create to ensure behavior is the same.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2 years agos4: torture: Ensure a failed file create doesn't create the file.
Jeremy Allison [Wed, 28 Mar 2018 17:54:30 +0000 (10:54 -0700)]
s4: torture: Ensure a failed file create doesn't create the file.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2 years agos3: smbd: Files or directories can't be opened DELETE_ON_CLOSE without delete access.
Jeremy Allison [Wed, 28 Mar 2018 19:42:20 +0000 (12:42 -0700)]
s3: smbd: Files or directories can't be opened DELETE_ON_CLOSE without delete access.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2 years agolibads: Fix CID 1349423 Resource leak
Volker Lendecke [Wed, 28 Mar 2018 12:27:08 +0000 (07:27 -0500)]
libads: Fix CID 1349423 Resource leak

get_sorted_dc_list should already take care, but this way it's safer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 29 03:45:00 CEST 2018 on sn-devel-144

2 years agonet: Fix CID 1128559 Dereference null return value
Volker Lendecke [Wed, 28 Mar 2018 12:24:01 +0000 (07:24 -0500)]
net: Fix CID 1128559 Dereference null return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbstatus: Fix CID 1128560 Dereference null return value
Volker Lendecke [Wed, 28 Mar 2018 12:22:02 +0000 (07:22 -0500)]
smbstatus: Fix CID 1128560 Dereference null return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agovfs_fruit: Fix CID 1433613 Operands don't affect result
Volker Lendecke [Wed, 28 Mar 2018 12:17:59 +0000 (07:17 -0500)]
vfs_fruit: Fix CID 1433613 Operands don't affect result

Two changes: First, we can't check multiplication overflow after the
operation. This has to be done before with a division. Second, there
is no OFF_T_MAX, and both operands are size_t, so check for
SIZE_MAX. The result is assigned to off_t, but I'm not sure where the
automatic coercion from size_t to off_t would happen.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agodsdb: Fix CID 1433614 Dereference after null check
Volker Lendecke [Wed, 28 Mar 2018 12:10:59 +0000 (07:10 -0500)]
dsdb: Fix CID 1433614 Dereference after null check

This whole routine assumes module!=NULL, both in the successful as
well as in error cases. So checking for module!=NULL is confusing both
the reader as well as Coverity.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibads: Fix 1433611 Resource leak
Volker Lendecke [Wed, 28 Mar 2018 12:00:34 +0000 (07:00 -0500)]
libads: Fix 1433611 Resource leak

Not really a memleak due to the passed-in talloc ctx, but this way it's cleaner

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolsa_server: Fix CID 1433608 Dereference after null check
Volker Lendecke [Tue, 27 Mar 2018 22:03:15 +0000 (17:03 -0500)]
lsa_server: Fix CID 1433608 Dereference after null check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibads: Fix CID 1433606 Dereference before null check
Volker Lendecke [Tue, 27 Mar 2018 22:00:46 +0000 (17:00 -0500)]
libads: Fix CID 1433606 Dereference before null check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agondr_string: Do overflow checks in ndr_push/pull_charset
Volker Lendecke [Mon, 26 Mar 2018 10:02:01 +0000 (12:02 +0200)]
ndr_string: Do overflow checks in ndr_push/pull_charset

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Mar 28 16:08:16 CEST 2018 on sn-devel-144

2 years agondr_string: Fix a signed/unsigned glitch
Volker Lendecke [Mon, 26 Mar 2018 10:00:40 +0000 (12:00 +0200)]
ndr_string: Fix a signed/unsigned glitch

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoctdb-tests: Delete unused fake /etc/sysconfig/ctdb file
Martin Schwenke [Tue, 20 Mar 2018 09:20:55 +0000 (20:20 +1100)]
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

2 years agoctdb-scripts: Tunables are now loaded from ctdb.tunables
Martin Schwenke [Tue, 20 Feb 2018 07:22:33 +0000 (18:22 +1100)]
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>
2 years agoctdb-tests: Rename setup_config() to setup_tunable_config()
Martin Schwenke [Thu, 22 Mar 2018 03:39:45 +0000 (14:39 +1100)]
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>
2 years agoctdb-tests: Script options into per-script file
Martin Schwenke [Mon, 19 Feb 2018 03:58:48 +0000 (14:58 +1100)]
ctdb-tests: Script options into per-script file

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-scripts: Use load_script_options in event scripts
Martin Schwenke [Tue, 20 Feb 2018 01:56:42 +0000 (12:56 +1100)]
ctdb-scripts: Use load_script_options in event scripts

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-scripts: Add new function load_script_options()
Martin Schwenke [Mon, 19 Feb 2018 02:13:26 +0000 (13:13 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 91.lvs tests
Martin Schwenke [Thu, 22 Mar 2018 00:36:46 +0000 (11:36 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 60.nfs (and 06.nfs) tests
Martin Schwenke [Thu, 22 Mar 2018 01:05:10 +0000 (12:05 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 50.samba tests
Martin Schwenke [Thu, 22 Mar 2018 01:03:56 +0000 (12:03 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 49.winbind tests
Martin Schwenke [Thu, 22 Mar 2018 00:17:47 +0000 (11:17 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 41.httpd tests
Martin Schwenke [Wed, 21 Mar 2018 20:19:14 +0000 (07:19 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 40.vsftpd tests
Martin Schwenke [Wed, 21 Mar 2018 20:16:02 +0000 (07:16 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 31.clamd tests
Martin Schwenke [Wed, 21 Mar 2018 20:11:59 +0000 (07:11 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 20.multipathd tests
Martin Schwenke [Wed, 21 Mar 2018 20:04:49 +0000 (07:04 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 13.per_ip_routing tests
Martin Schwenke [Wed, 21 Mar 2018 20:01:08 +0000 (07:01 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 11.natgw tests
Martin Schwenke [Wed, 21 Mar 2018 19:56:18 +0000 (06:56 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 10.interface tests
Martin Schwenke [Wed, 21 Mar 2018 11:21:46 +0000 (22:21 +1100)]
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>
2 years agoctdb-tests: Use setup_script_options() in 05.system tests
Martin Schwenke [Wed, 21 Mar 2018 11:18:56 +0000 (22:18 +1100)]
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>
2 years agoctdb-tests: New function setup_script_options()
Martin Schwenke [Thu, 8 Feb 2018 01:18:56 +0000 (12:18 +1100)]
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>
2 years agoctdb-scripts: Split CTDB configuration loading
Martin Schwenke [Tue, 6 Feb 2018 00:25:56 +0000 (11:25 +1100)]
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>
2 years agoctdb-docs: Promote CTDB_INIT_STYLE to global options section
Martin Schwenke [Mon, 19 Feb 2018 04:32:02 +0000 (15:32 +1100)]
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>
2 years agoctdb-scripts: Clean up function detect_init_style()
Martin Schwenke [Mon, 19 Feb 2018 04:29:43 +0000 (15:29 +1100)]
ctdb-scripts: Clean up function detect_init_style()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Remove unused functions and stubs
Martin Schwenke [Mon, 12 Feb 2018 19:55:35 +0000 (06:55 +1100)]
ctdb-tests: Remove unused functions and stubs

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: statd-callout script setup modularisation
Martin Schwenke [Tue, 13 Feb 2018 00:17:46 +0000 (11:17 +1100)]
ctdb-tests: statd-callout script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 91.lvs event script setup modularisation
Martin Schwenke [Mon, 12 Feb 2018 05:46:17 +0000 (16:46 +1100)]
ctdb-tests: 91.lvs event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 60.nfs (and 06.nfs) event script setup modularisation
Martin Schwenke [Mon, 12 Feb 2018 19:53:44 +0000 (06:53 +1100)]
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>
2 years agoctdb-tests: 50.samba event script setup modularisation
Martin Schwenke [Mon, 12 Feb 2018 05:25:15 +0000 (16:25 +1100)]
ctdb-tests: 50.samba event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 49.winbind event script setup modularisation
Martin Schwenke [Mon, 12 Feb 2018 03:10:12 +0000 (14:10 +1100)]
ctdb-tests: 49.winbind event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 41.httpd event script setup modularisation
Martin Schwenke [Mon, 12 Feb 2018 03:02:20 +0000 (14:02 +1100)]
ctdb-tests: 41.httpd event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 40.vsftpd event script setup modularisation
Martin Schwenke [Mon, 12 Feb 2018 02:47:56 +0000 (13:47 +1100)]
ctdb-tests: 40.vsftpd event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 31.clamd event script setup modularisation
Martin Schwenke [Mon, 12 Feb 2018 02:58:42 +0000 (13:58 +1100)]
ctdb-tests: 31.clamd event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 20.multipathd event script setup modularisation
Martin Schwenke [Mon, 12 Feb 2018 02:40:42 +0000 (13:40 +1100)]
ctdb-tests: 20.multipathd event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 13.per_ip_routing event script setup modularisation
Martin Schwenke [Mon, 12 Feb 2018 02:37:02 +0000 (13:37 +1100)]
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>
2 years agoctdb-tests: 11.natgw event script setup modularisation
Martin Schwenke [Mon, 12 Feb 2018 00:42:04 +0000 (11:42 +1100)]
ctdb-tests: 11.natgw event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 10.interface event script setup modularisation
Martin Schwenke [Thu, 8 Feb 2018 11:01:49 +0000 (22:01 +1100)]
ctdb-tests: 10.interface event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 05.system event script setup modularisation
Martin Schwenke [Wed, 7 Feb 2018 19:54:27 +0000 (06:54 +1100)]
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>
2 years agoctdb-tests: 01.reclock event script setup modularisation
Martin Schwenke [Wed, 7 Feb 2018 19:24:01 +0000 (06:24 +1100)]
ctdb-tests: 01.reclock event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 00.ctdb testing setup modularisation
Martin Schwenke [Wed, 7 Feb 2018 19:04:58 +0000 (06:04 +1100)]
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>
2 years agoctdb-tests: Define generic setup() function
Martin Schwenke [Wed, 7 Feb 2018 19:00:25 +0000 (06:00 +1100)]
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>
2 years agoctdb-tests: statd-callout.sh simple 80 column fixups
Martin Schwenke [Tue, 20 Mar 2018 09:46:41 +0000 (20:46 +1100)]
ctdb-tests: statd-callout.sh simple 80 column fixups

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 60.nfs.sh simple 80 column fixups and reordering
Martin Schwenke [Tue, 20 Mar 2018 09:42:21 +0000 (20:42 +1100)]
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>
2 years agoctdb-tests: 20.multipathd.sh 80 column fixups
Martin Schwenke [Tue, 20 Mar 2018 09:38:13 +0000 (20:38 +1100)]
ctdb-tests: 20.multipathd.sh 80 column fixups

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 11.natgw.sh simple 80 column fixups
Martin Schwenke [Tue, 20 Mar 2018 09:51:00 +0000 (20:51 +1100)]
ctdb-tests: 11.natgw.sh simple 80 column fixups

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 10.interface.sh simple 80 column fixups
Martin Schwenke [Tue, 20 Mar 2018 09:31:19 +0000 (20:31 +1100)]
ctdb-tests: 10.interface.sh simple 80 column fixups

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: 05.system.sh simple 80 column fixups
Martin Schwenke [Tue, 20 Mar 2018 09:28:57 +0000 (20:28 +1100)]
ctdb-tests: 05.system.sh simple 80 column fixups

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Create statd-callout.sh
Martin Schwenke [Mon, 19 Mar 2018 09:57:36 +0000 (20:57 +1100)]
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>
2 years agoctdb-tests: Create 91.lvs.sh
Martin Schwenke [Mon, 19 Mar 2018 09:55:10 +0000 (20:55 +1100)]
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>
2 years agoctdb-tests: Create 60.nfs.sh and 06.nfs.sh
Martin Schwenke [Mon, 19 Mar 2018 09:53:21 +0000 (20:53 +1100)]
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>
2 years agoctdb-tests: Create 50.samba.sh
Martin Schwenke [Mon, 19 Mar 2018 09:49:48 +0000 (20:49 +1100)]
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>
2 years agoctdb-tests: Create 49.winbind.sh
Martin Schwenke [Mon, 19 Mar 2018 09:47:48 +0000 (20:47 +1100)]
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>
2 years agoctdb-tests: Create 41.httpd.sh
Martin Schwenke [Mon, 19 Mar 2018 09:43:15 +0000 (20:43 +1100)]
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>
2 years agoctdb-tests: Create 40.vsftpd.sh
Martin Schwenke [Mon, 19 Mar 2018 09:42:04 +0000 (20:42 +1100)]
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>
2 years agoctdb-tests: Create 20.multipathd.sh
Martin Schwenke [Mon, 19 Mar 2018 09:40:40 +0000 (20:40 +1100)]
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>
2 years agoctdb-tests: Create 13.per_ip_routing.sh
Martin Schwenke [Mon, 19 Mar 2018 09:39:27 +0000 (20:39 +1100)]
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>
2 years agoctdb-tests: Create 11.natgw.sh
Martin Schwenke [Mon, 19 Mar 2018 09:38:28 +0000 (20:38 +1100)]
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>
2 years agoctdb-tests: Create 10.interface.sh
Martin Schwenke [Mon, 19 Mar 2018 09:36:22 +0000 (20:36 +1100)]
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>
2 years agoctdb-tests: Create 05.system.sh
Martin Schwenke [Mon, 19 Mar 2018 09:31:33 +0000 (20:31 +1100)]
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>
2 years agoctdb-tests: Create 01.reclock.sh
Martin Schwenke [Mon, 19 Mar 2018 09:30:03 +0000 (20:30 +1100)]
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>
2 years agoctdb-tests: Create 00.ctdb.sh
Martin Schwenke [Fri, 9 Feb 2018 04:57:19 +0000 (15:57 +1100)]
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>
2 years agoctdb-tests: Allow modularisation of event script testing support
Martin Schwenke [Wed, 7 Feb 2018 18:57:44 +0000 (05:57 +1100)]
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>
2 years agoctdb-tests: Clean up handling of CTDB_SCRIPT_VARDIR
Martin Schwenke [Thu, 8 Feb 2018 11:04:51 +0000 (22:04 +1100)]
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>
2 years agoctdb-tests: Clean up fake share handling
Martin Schwenke [Mon, 12 Feb 2018 04:41:27 +0000 (15:41 +1100)]
ctdb-tests: Clean up fake share handling

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: New function setup_numnodes()
Martin Schwenke [Thu, 8 Feb 2018 10:52:51 +0000 (21:52 +1100)]
ctdb-tests: New function setup_numnodes()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Tweak debug function
Martin Schwenke [Mon, 12 Feb 2018 04:41:09 +0000 (15:41 +1100)]
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>
2 years agoctdb-tests: Make date handling consistent in 00.ctdb tests
Martin Schwenke [Wed, 21 Mar 2018 07:43:35 +0000 (18:43 +1100)]
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>
2 years agoctdb-tests: New support functions setup_dbdir() and setup_date()
Martin Schwenke [Fri, 9 Feb 2018 05:36:04 +0000 (16:36 +1100)]
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>
2 years agoctdb-tests: Don't set FAKE_ETHTOOL_LINK_DOWN globally
Martin Schwenke [Thu, 8 Feb 2018 10:58:51 +0000 (21:58 +1100)]
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>
2 years agoctdb-tests: Move variable FAKE_IP_STATE into the ip stub
Martin Schwenke [Thu, 8 Feb 2018 05:29:05 +0000 (16:29 +1100)]
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>
2 years agoctdb-tests: Move variable FAKE_CTDB_IFACES_DOWN into ctdb stub
Martin Schwenke [Wed, 21 Mar 2018 03:48:12 +0000 (14:48 +1100)]
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>
2 years agoctdb-tests: Remove case statement in ctdb stub
Martin Schwenke [Wed, 21 Mar 2018 05:37:57 +0000 (16:37 +1100)]
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>
2 years agoctdb-tests: Update argument handling of ctdb stub functions
Martin Schwenke [Wed, 21 Mar 2018 05:21:06 +0000 (16:21 +1100)]
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>
2 years agoctdb-tests: Move ctdb stub code from case statement to functions
Martin Schwenke [Wed, 21 Mar 2018 03:50:53 +0000 (14:50 +1100)]
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>
2 years agoctdb-tests: Drop unused ctdb stub scriptstatus and xpnn commands
Martin Schwenke [Thu, 8 Feb 2018 05:21:36 +0000 (16:21 +1100)]
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>
2 years agoctdb-tests: Fix a bug in the ctdb stub's moveip command
Martin Schwenke [Wed, 21 Mar 2018 04:42:22 +0000 (15:42 +1100)]
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>
2 years agoctdb-tests: New global variable FAKE_NETWORK_STATE
Martin Schwenke [Thu, 8 Feb 2018 05:27:20 +0000 (16:27 +1100)]
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>
2 years agoctdb-tests: Make FAKE_CTDB_STATE globally set
Martin Schwenke [Thu, 8 Feb 2018 05:25:20 +0000 (16:25 +1100)]
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>
2 years agoctdb-scripts: Drop unused functions
Martin Schwenke [Thu, 22 Mar 2018 04:52:05 +0000 (15:52 +1100)]
ctdb-scripts: Drop unused functions

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