samba.git
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

18 months agoctdb-tests: Add debug messages for unimplemented functions
Amitay Isaacs [Mon, 19 Mar 2018 03:26:09 +0000 (14:26 +1100)]
ctdb-tests: Add debug messages for unimplemented functions

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
18 months agoctdb-tests: Add database traverse tests
Amitay Isaacs [Mon, 5 Feb 2018 05:08:32 +0000 (16:08 +1100)]
ctdb-tests: Add database traverse tests

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
18 months agoctdb-tests: Implement traverse control in fake_ctdbd
Amitay Isaacs [Mon, 5 Feb 2018 04:59:26 +0000 (15:59 +1100)]
ctdb-tests: Implement traverse control in fake_ctdbd

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
18 months agoctdb-tests: Add persistent database tests
Amitay Isaacs [Mon, 28 Aug 2017 05:29:58 +0000 (15:29 +1000)]
ctdb-tests: Add persistent database tests

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
18 months agoctdb-tests: Implement transaction control in fake_ctdbd
Amitay Isaacs [Mon, 5 Feb 2018 03:03:27 +0000 (14:03 +1100)]
ctdb-tests: Implement transaction control in fake_ctdbd

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
18 months agoctdb-tests: Add volatile database tests
Amitay Isaacs [Mon, 19 Mar 2018 03:00:02 +0000 (14:00 +1100)]
ctdb-tests: Add volatile database tests

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
18 months agoctdb-tests: Add req_call processing in fake_ctdbd
Amitay Isaacs [Mon, 5 Feb 2018 04:56:57 +0000 (15:56 +1100)]
ctdb-tests: Add req_call processing in fake_ctdbd

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
18 months agoctdb-tests: Use seqnum from tdb if available in fake_ctdbd
Amitay Isaacs [Mon, 5 Feb 2018 03:01:29 +0000 (14:01 +1100)]
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>
18 months agoctdb-tests: Add database attach tests
Amitay Isaacs [Fri, 25 Aug 2017 07:20:04 +0000 (17:20 +1000)]
ctdb-tests: Add database attach tests

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
18 months agoctdb-tests: Implement database attach control in fake_ctdbd
Amitay Isaacs [Mon, 5 Feb 2018 02:59:22 +0000 (13:59 +1100)]
ctdb-tests: Implement database attach control in fake_ctdbd

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
18 months agoctdb-tests: Add dbdir option for creating databases in fake_ctdbd
Amitay Isaacs [Mon, 5 Feb 2018 01:43:02 +0000 (12:43 +1100)]
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>
18 months agoctdb-tests: Convert database map to a linked list in fake_ctdbd
Amitay Isaacs [Mon, 5 Feb 2018 01:11:32 +0000 (12:11 +1100)]
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>
18 months agoctdb-client: Add missing initialization of tevent_context
Amitay Isaacs [Mon, 19 Mar 2018 02:58:43 +0000 (13:58 +1100)]
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>
18 months agoctdb-client: Do not try to allocate 0 sized record
Amitay Isaacs [Mon, 19 Mar 2018 02:38:28 +0000 (13:38 +1100)]
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>
18 months agowinbindd: Use talloc_zero_array for consistency with other winbindd_domain allocators
Andrew Bartlett [Wed, 21 Mar 2018 08:23:13 +0000 (21:23 +1300)]
winbindd: Use talloc_zero_array for consistency with other winbindd_domain allocators

The other allocator for this structure uses talloc_zero()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Mar 24 07:21:37 CET 2018 on sn-devel-144

18 months agowinbindd: Do re-connect if the RPC call fails in the passdb case
Andrew Bartlett [Wed, 21 Mar 2018 07:44:31 +0000 (20:44 +1300)]
winbindd: Do re-connect if the RPC call fails in the passdb case

This is very, very unlikely but possible as in the AD case the RPC server is in
another process that may eventually be able to restart.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
18 months agowinbindd: Add a cache of the samr and lsa handles for the passdb domain
Andrew Bartlett [Wed, 21 Mar 2018 07:43:10 +0000 (20:43 +1300)]
winbindd: Add a cache of the samr and lsa handles for the passdb domain

This domain is very close, in AD DC configurations over a internal ncacn_np pipe
and otherwise in the same process via C linking.  It is however very expensive
to re-create the binding handle per SID->name lookup, so keep a cache.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
18 months agoautobuild: Move "none" environment to samba-none-env
Andrew Bartlett [Sat, 3 Mar 2018 06:51:29 +0000 (19:51 +1300)]
autobuild: Move "none" environment to samba-none-env

This takes this part of the test out of the main, slow samba task
but also keeps it away from samba-o3 which is up against the 50min
budget on travis-ci.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar 23 12:00:40 CET 2018 on sn-devel-144

18 months agoAdd tests for dckeytab python module
David Mulder [Fri, 16 Feb 2018 17:00:19 +0000 (10:00 -0700)]
Add tests for dckeytab python module

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agopython3 port for dckeytab module
Noel Power [Fri, 2 Feb 2018 16:08:48 +0000 (16:08 +0000)]
python3 port for dckeytab module

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agoAdd python tests for samba.gpo module
David Mulder [Mon, 12 Feb 2018 19:21:42 +0000 (12:21 -0700)]
Add python tests for samba.gpo module

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agolibgpo: port samba.gpo to python3
David Mulder [Tue, 30 Jan 2018 19:31:42 +0000 (12:31 -0700)]
libgpo: port samba.gpo to python3

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agotests/dcerpc/misc.GUID: improve tests
Joe Guo [Tue, 20 Mar 2018 23:13:56 +0000 (12:13 +1300)]
tests/dcerpc/misc.GUID: improve tests

1. Merge tests for different formats into a for loop, make it easy to
read and extend.
2. Add test for invalid formats.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agotests/dcerpc/misc.GUID: test that long-form py3 bytes works
Douglas Bagnall [Fri, 16 Mar 2018 03:33:44 +0000 (16:33 +1300)]
tests/dcerpc/misc.GUID: test that long-form py3 bytes works

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
18 months agosamba python tests: Ensure GUIDTests cover all input formats
Noel Power [Wed, 28 Feb 2018 14:40:26 +0000 (14:40 +0000)]
samba python tests: Ensure GUIDTests cover all input formats

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
18 months agos4/librpc: GUID should accept string or bytes in python3
Noel Power [Wed, 28 Feb 2018 03:25:55 +0000 (16:25 +1300)]
s4/librpc: GUID should accept string or bytes in python3

In python3 you can't store a binary blob GUID in a string class, you
need to use 'bytes'. This change ensures python2 code continues to use
a string and in python3 both 'bytes' and 'string' are supported.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
18 months agopython: Add compatability helpers to determine if type is really bytes
Noel Power [Wed, 7 Mar 2018 14:39:54 +0000 (14:39 +0000)]
python: Add compatability helpers to determine if type is really bytes

py3compat has PyBytes_Check macro which evalates to PyString_Check in
python2. To help switch behaviour based on whether you are dealing
with the bytes type the following macros have been added.

IsPy3Bytes
IsPy3BytesOrString

IsPy3Bytes will evaluate to false in python2 and will return the
expected result in python3. IsPy3BytesOrString will test for string
type alone in python2 or bytes and string in python3.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
18 months agos4/dsdb: python3 api should take 'bytes'
Noel Power [Thu, 22 Feb 2018 12:49:36 +0000 (12:49 +0000)]
s4/dsdb: python3 api should take 'bytes'

Attributes are properly represented by 'bytes' and *maybe* can be
converted into strings (if they are text).
py_dsdb_normalise_attributes currently expects strings, this is fine
in python2 however in python3 we need to actually pass a 'bytes'
class.

Signed-off-by: Noel Power <noel.power@suse.com>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
18 months agos4/selftest: enable netbios python test for python3 too
Noel Power [Thu, 15 Feb 2018 20:46:53 +0000 (20:46 +0000)]
s4/selftest: enable netbios python test for python3 too

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agopython3 port for netbios module
Noel Power [Fri, 2 Feb 2018 17:08:00 +0000 (17:08 +0000)]
python3 port for netbios module

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agos4/selftest: Add simple python netbios test python2 only for the moment
Noel Power [Thu, 15 Feb 2018 20:43:53 +0000 (20:43 +0000)]
s4/selftest: Add simple python netbios test python2 only for the moment

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agolibcli/nbt: Fix illegal tuple index access.
Noel Power [Thu, 15 Feb 2018 15:02:58 +0000 (15:02 +0000)]
libcli/nbt: Fix illegal tuple index access.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agoREADME.Coding: remove reference to non-existent prog_guide4.txt
Douglas Bagnall [Fri, 23 Mar 2018 02:12:06 +0000 (15:12 +1300)]
README.Coding: remove reference to non-existent prog_guide4.txt

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
18 months agoREADME.Coding: mention compatible Python versions
Douglas Bagnall [Fri, 23 Mar 2018 02:09:57 +0000 (15:09 +1300)]
README.Coding: mention compatible Python versions

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
18 months agolib/tdb: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:07:31 +0000 (14:07 +0000)]
lib/tdb: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agoauth/credentials/test: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:06:55 +0000 (14:06 +0000)]
auth/credentials/test: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agoscript: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:06:21 +0000 (14:06 +0000)]
script: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agos3/script/tests: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:04:29 +0000 (14:04 +0000)]
s3/script/tests: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agoselftest: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:03:29 +0000 (14:03 +0000)]
selftest: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agos4/selftest: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:02:52 +0000 (14:02 +0000)]
s4/selftest: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agos4/torture/drs: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:02:18 +0000 (14:02 +0000)]
s4/torture/drs: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agos4/scripting: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:01:17 +0000 (14:01 +0000)]
s4/scripting: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agos4/script: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 13:59:50 +0000 (13:59 +0000)]
s4/script: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agos3/dsdb: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 13:57:01 +0000 (13:57 +0000)]
s3/dsdb: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agosamba python libs: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 13:53:45 +0000 (13:53 +0000)]
samba python libs: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agosamba-tool: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 13:49:09 +0000 (13:49 +0000)]
samba-tool: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agosamba python tests: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 13:38:42 +0000 (13:38 +0000)]
samba python tests: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18 months agoFix invocation of gnutls_aead_cipher_encrypt()
Timur I. Bakeyev [Thu, 22 Mar 2018 04:47:58 +0000 (05:47 +0100)]
Fix invocation of gnutls_aead_cipher_encrypt()

Which was failing with GNUTLS_E_SHORT_MEMORY_BUFFER - The given memory
buffer is too short to hold parameters.

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

Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Fri Mar 23 07:25:30 CET 2018 on sn-devel-144

18 months agoselftest: Ensure tmpkpasswdscript is always under $PREFIX
Andrew Bartlett [Thu, 22 Mar 2018 00:18:39 +0000 (13:18 +1300)]
selftest: Ensure tmpkpasswdscript is always under $PREFIX

Otherwise it might not be removed at the end of the test

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
18 months agoselftest: Align cleanup of tmpkpasswdscript with scripts that use it
Andrew Bartlett [Thu, 22 Mar 2018 00:15:34 +0000 (13:15 +1300)]
selftest: Align cleanup of tmpkpasswdscript with scripts that use it

Some scripts removed it without creating it and the others created it
and did not remove it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
18 months agos3:lib: Fix probably a copy&paste error in namemap_cache_set_sid2name()
Andreas Schneider [Wed, 21 Mar 2018 19:25:09 +0000 (20:25 +0100)]
s3:lib: Fix probably a copy&paste error in namemap_cache_set_sid2name()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 23 01:59:08 CET 2018 on sn-devel-144

18 months agos3: smbd: always set vuid in check_user_ok()
Ralph Boehme [Thu, 22 Mar 2018 07:03:58 +0000 (08:03 +0100)]
s3: smbd: always set vuid in check_user_ok()

A SMB session reauth will have invalidated conn->vuid via
conn_clear_vuid_caches().

Ensure conn->vuid always has the vuid of the current user in
check_user_ok().

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar 22 18:26:04 CET 2018 on sn-devel-144

18 months agoselftest: consistently produce high-res UTC time
Jamie McClymont [Thu, 25 Jan 2018 04:23:06 +0000 (17:23 +1300)]
selftest: consistently produce high-res UTC time

Currently some subunit reporters throughout the codebase provide low-res time,
meaning timestamps jump back and forth in the subunit file. Also, some subunit
reporters produce UTC timestamps while others produce local time. UTC was chosen
as the standard for this commit since all of the timestamps end with a Z (= Zulu
= UTC).

Signed-off-by: Jamie McClymont <jamiemcclymont@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Mar 22 13:26:44 CET 2018 on sn-devel-144