samba.git
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months 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>
18 months agoctdb-script: Drop CTDB_MANAGED_SERVICES configuration option
Martin Schwenke [Thu, 22 Mar 2018 04:33:58 +0000 (15:33 +1100)]
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>
18 months agoselftest: Run net.api.become.dc against less roles
Andrew Bartlett [Thu, 22 Mar 2018 03:49:53 +0000 (16:49 +1300)]
selftest: Run net.api.become.dc against less roles

This test is slower than many and need not be run five times.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Mar 28 01:53:56 CEST 2018 on sn-devel-144

18 months agoselftest: Do not run *.lock tests against both nt4_dc and ad_dc
Andrew Bartlett [Thu, 22 Mar 2018 03:45:05 +0000 (16:45 +1300)]
selftest: Do not run *.lock tests against both nt4_dc and ad_dc

This part of the protocol is not changed by being an AD DC.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoselftest: Move slow raw_protocol test to chgdcpass environment
Andrew Bartlett [Thu, 22 Mar 2018 03:25:59 +0000 (16:25 +1300)]
selftest: Move slow raw_protocol test to chgdcpass environment

The ad_dc environment is busy and we need to keep it under 50mins for travis CI, so run
this on a different environment with a shorter runtime.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agogitlab-ci: Split up build_samba_others and build_ctdb tasks
Andrew Bartlett [Thu, 22 Mar 2018 02:13:18 +0000 (15:13 +1300)]
gitlab-ci: Split up build_samba_others and build_ctdb tasks

These make too much output and the shared runners on GitLab CI object to
sending more than 4MB of output.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoselftest: Do not run krb5.kdc machine account test against ad_dc
Andrew Bartlett [Wed, 21 Mar 2018 23:21:52 +0000 (12:21 +1300)]
selftest: Do not run krb5.kdc machine account test against ad_dc

This code is already well tested against fl2008r2dc and just as per
8f1557a2c43e287c07723c16be78e1d858f4111d this test is slow and we can afford to be
more selective here.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoselftest: Do not run raw.notify, smb2.oplock and raw.oplock twice
Andrew Bartlett [Wed, 21 Mar 2018 23:02:16 +0000 (12:02 +1300)]
selftest: Do not run raw.notify, smb2.oplock and raw.oplock twice

These are slower tests that do not need to be run against the ad_dc configuration
in particular.

This saves time in the ad_dc job which needs to stay under 50mins to
pass on travis-ci (and faster tests are better for everyone anyway).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoautobuild: Run all envs that depend on ad_dc in the ad_dc job
Andrew Bartlett [Wed, 21 Mar 2018 19:25:41 +0000 (08:25 +1300)]
autobuild: Run all envs that depend on ad_dc in the ad_dc job

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agogitlab: Run fileserver tests on "private" not "shared"
Andrew Bartlett [Tue, 20 Mar 2018 18:24:23 +0000 (07:24 +1300)]
gitlab: Run fileserver tests on "private" not "shared"

This might make the delaywrite tests pass

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoautobuild: Split up the build further with samba-ad-dc-2
Andrew Bartlett [Tue, 20 Mar 2018 18:02:42 +0000 (07:02 +1300)]
autobuild: Split up the build further with samba-ad-dc-2

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agogitlab-ci: Set shared and private tags to allow builds that need ext4 to pass
Andrew Bartlett [Tue, 20 Mar 2018 02:07:03 +0000 (15:07 +1300)]
gitlab-ci: Set shared and private tags to allow builds that need ext4 to pass

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoselftest: Move samba.tests.samba_tool{.dnscmd,.sites} to chgdcpass
Andrew Bartlett [Mon, 5 Mar 2018 04:08:51 +0000 (17:08 +1300)]
selftest: Move samba.tests.samba_tool{.dnscmd,.sites} to chgdcpass

This helps reduce the runtime of ad_dc which needs to be under 50mins
including build time to run on travis-ci.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoselftest: Move slower base.deny1 and base.deny2 to fileserver environment
Andrew Bartlett [Sun, 4 Mar 2018 19:04:22 +0000 (08:04 +1300)]
selftest: Move slower base.deny1 and base.deny2 to fileserver environment

This avoids these running in the ad_dc environment which we need to get under 50mins for
travis-ci.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoautobuild: Try and test different configure options for new environments
Andrew Bartlett [Sun, 4 Mar 2018 08:36:22 +0000 (21:36 +1300)]
autobuild: Try and test different configure options for new environments

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoMove smbtorture3 tests to fileserver environment
Andrew Bartlett [Sun, 4 Mar 2018 08:33:50 +0000 (21:33 +1300)]
Move smbtorture3 tests to fileserver environment

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoselftest: Move base.delaywrite tests to fileserver environment
Andrew Bartlett [Sun, 4 Mar 2018 08:20:31 +0000 (21:20 +1300)]
selftest: Move base.delaywrite tests to fileserver environment

This aims to keep the ad_dc tests well below 50mins for travis CI and
base.delaywrite is very slow.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoautobuild: Remove fileserver tests from the main build
Andrew Bartlett [Sun, 4 Mar 2018 08:32:09 +0000 (21:32 +1300)]
autobuild: Remove fileserver tests from the main build

Again, this is to allow these to run in the 50min timelimit
of travis-ci and so gain test coverage.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoautobuild: Run all "ad_dc" environment tests in samba-ad-dc
Andrew Bartlett [Thu, 29 Jun 2017 23:13:55 +0000 (11:13 +1200)]
autobuild: Run all "ad_dc" environment tests in samba-ad-dc

This allows us not to run ad_dc tests in the main build, making the
autobuild process faster.  The ad_dc tests run in less than 50mins
on travis-ci, which allows this part of the tests to be run.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoselftest: Do not run smb2.notify against nt4_dc and ad_dc
Andrew Bartlett [Sat, 3 Mar 2018 08:03:11 +0000 (21:03 +1300)]
selftest: Do not run smb2.notify against nt4_dc and ad_dc

This is a slow test and we need to keep the time on ad_dc down to below 50mins total
for travis-ci.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agogitlab-ci: Add samba-nt4 environment to the CI
Andrew Bartlett [Mon, 4 Dec 2017 22:34:08 +0000 (11:34 +1300)]
gitlab-ci: Add samba-nt4 environment to the CI

This parallel build is de-coupled from the main samba build

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agotravis-ci: Run new samba-nt4 environment
Andrew Bartlett [Thu, 29 Jun 2017 23:44:58 +0000 (11:44 +1200)]
travis-ci: Run new samba-nt4 environment

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoautobuild: Run nt4_dc and nt4_member tests in parallel
Andrew Bartlett [Thu, 29 Jun 2017 23:15:40 +0000 (11:15 +1200)]
autobuild: Run nt4_dc and nt4_member tests in parallel

These do not interact with the main AD DC environments, so can run in parallel

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agogitlab-ci: add git variable to speed up clone
Joe Guo [Tue, 12 Dec 2017 01:26:07 +0000 (14:26 +1300)]
gitlab-ci: add git variable to speed up clone

Set GIT_STATEGY to fetch, and GIT_DEPTH to 3.
This will speed up cloning for repos.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agogitlab-ci: set docker image and change tag
Joe Guo [Mon, 27 Nov 2017 21:20:54 +0000 (10:20 +1300)]
gitlab-ci: set docker image and change tag

1. Specify docker image to use in gitlab-ci.yml
2. Change tag autobuild to docker

So we can use gitlab.com shared runners.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agogitlab-ci: Create swap space to work around the 2G image
Andrew Bartlett [Tue, 20 Mar 2018 01:15:47 +0000 (14:15 +1300)]
gitlab-ci: Create swap space to work around the 2G image

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
18 months agoAllow AESNI to be used on all processor supporting AESNI, not just Intel's This impro...
Eric Vannier [Fri, 23 Mar 2018 04:32:56 +0000 (21:32 -0700)]
Allow AESNI to be used on all processor supporting AESNI, not just Intel's This improves performance/reduced CPU usage. Tests performed: - Ran on Ivy Bridge and Ryzen and verified that AESNI is detected (crypto tests) - Ran on Ryzen, and observed 50% increased speed.

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

Signed-off-by: Eric Vannier <evannier@google.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 27 13:50:09 CEST 2018 on sn-devel-144

18 months agoctdb-tests: Don't expand octal escapes in unit test output
Martin Schwenke [Mon, 26 Mar 2018 07:32:57 +0000 (18:32 +1100)]
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