Christof Schmitt [Thu, 5 Dec 2013 22:53:47 +0000 (15:53 -0700)]
selftest: Remove samba3.smb2.lock.*.rw-exclusive from flapping file
This test demonstrates a problem with byte range locks and AIO.
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec 6 05:19:37 CET 2013 on sn-devel-104
Christof Schmitt [Thu, 5 Dec 2013 22:22:13 +0000 (15:22 -0700)]
selftest: Run smb2.lock tests also against AIO share
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Christof Schmitt [Thu, 5 Dec 2013 22:20:06 +0000 (15:20 -0700)]
selftest: Introduce share for testing AIO
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Christof Schmitt [Thu, 5 Dec 2013 23:20:26 +0000 (16:20 -0700)]
s3: Return correct error code from SMB2 AIO read failure
This is similar to commit
27e20d5d60ea8aa526bcb7c2dfc18dd2de0bb97b which
fixed the same case for SMB2 writes: When sending the AIO read fails,
return the real error instead of mapping it to NT_STATUS_FILE_CLOSED.
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Christof Schmitt [Thu, 5 Dec 2013 22:57:54 +0000 (15:57 -0700)]
s3-aio: Use correct locking context for SMB2
The synchronous SMB2 reads and writes use open_persistent_id. The AIO
codepathes have to use the same, otherwise a write will conflict with a
lock on the same open file.
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:02:00 +0000 (14:02 +0100)]
s3-torture: Call cli_flush().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Dec 6 03:07:32 CET 2013 on sn-devel-104
Andreas Schneider [Wed, 4 Dec 2013 13:01:59 +0000 (14:01 +0100)]
krb5_wrap: Move function declaration outside the function.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:58 +0000 (14:01 +0100)]
s3-libsmb: Fix a memory leak in get_pdc_ip().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:57 +0000 (14:01 +0100)]
s3-torture: Make sure status is used initialized.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:56 +0000 (14:01 +0100)]
s3-torture: Fix several memory leaks in delete_fn().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:55 +0000 (14:01 +0100)]
s3-utils: Fix a memory leak in smbget.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:54 +0000 (14:01 +0100)]
s4-torture: Use talloc for asprintf.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:53 +0000 (14:01 +0100)]
s4-torture: Fix out of bound array access.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:52 +0000 (14:01 +0100)]
s3-torture: Comment out dead code in spoolss test.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:51 +0000 (14:01 +0100)]
s4-torture: Fix some compile warnings in spoolss.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:50 +0000 (14:01 +0100)]
s4-torture: Make sure handles are correctly initialized.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:49 +0000 (14:01 +0100)]
s4-torture: Make sure the handles are initialized correctly.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:48 +0000 (14:01 +0100)]
s4-torture: Make sure the handles are not used uninitialized.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 4 Dec 2013 13:01:47 +0000 (14:01 +0100)]
s4-libcli: Add smb2_util_handle_empty().
Will be used in the next commit.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
David Disseldorp [Thu, 5 Dec 2013 19:12:53 +0000 (20:12 +0100)]
torture: match Windows responses to bad shadow copy IDs
test_fsrvp_bad_id() issues DeleteShareMapping requests with invalid
shadow copy IDs, expect Windows Server 2012 return codes.
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
David Disseldorp [Thu, 5 Dec 2013 19:12:52 +0000 (20:12 +0100)]
torture: test duplicate shares in FSRVP shadow-copy set
MS-FSRVP 3.1.4.4 documents the requirement for failure when duplicate
volume names are encountered on AddToShadowCopySet.
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Volker Lendecke [Thu, 5 Dec 2013 14:50:58 +0000 (15:50 +0100)]
smbd: Fix a panic when a smb2 brlock times out
Found by Peter Somogyi.
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 Dec 5 21:21:35 CET 2013 on sn-devel-104
Jeremy Allison [Wed, 4 Dec 2013 01:26:26 +0000 (17:26 -0800)]
smbtorture: New torture test for bug #9870.
Not fetching the latest modification time on a folder if we have read locks on it.
Prove we should just rely on the mtime value from the underlying
filesystem, even with an open handle.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9870
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Dec 5 10:05:06 CET 2013 on sn-devel-104
Jeremy Allison [Wed, 4 Dec 2013 01:22:19 +0000 (17:22 -0800)]
smbd - allow updates on directory write times on open handles.
If we set a non-null 'old timestamp' in the share mode database
when creating a directory handle, this prevents mtime (write time)
updates from being seen by clients, as we will always return the
timestamp stored in the database whilst the handle is open.
For files this is ok, as we update the stored timestamp
ourselves when we write to the handle. For directories
we should just rely on the mtime value from the underlying
filesystem.
Torture test to follow.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9870
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Volker Lendecke [Wed, 4 Dec 2013 15:37:21 +0000 (15:37 +0000)]
idmap_cache: Use gencache_parse
This avoids a few tallocs and brings down user CPU a bit more
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Dec 5 03:06:10 CET 2013 on sn-devel-104
Volker Lendecke [Wed, 4 Dec 2013 15:14:03 +0000 (15:14 +0000)]
idmap_cache: Use an fstring instead of talloc_asprintf
In a test doing one million uid2sid calls this brings down user CPU from
1.3 seconds to 0.9 seconds. And it saves a few code lines.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Volker Lendecke [Tue, 3 Dec 2013 13:20:38 +0000 (13:20 +0000)]
messaging3: Do not go through messages.tdb for self-sends
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
David Disseldorp [Tue, 3 Dec 2013 13:45:50 +0000 (14:45 +0100)]
torture: enum snapshots after FSRVP creation
Issue an SMB2 ENUM_SNAPSHOTS ioctl following FSRVP snapshot creation to
cover Explorer previous file version use-cases.
This test will fail against Windows Server 2012, as FSRVP created
snapshots are not exposed via the ENUM_SNAPSHOTS ioctl.
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
David Disseldorp [Tue, 3 Dec 2013 13:45:49 +0000 (14:45 +0100)]
test: add fake_snap.pl for snapshot simulation
The script simulates snapshots by simply copying file data from the base
path to a snapshot path located under .snapshots/@GMT-%Y.%m.%d-%H.%M.%S/
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Michael Adam [Fri, 29 Nov 2013 09:15:20 +0000 (10:15 +0100)]
ctdb:tests: update README
explain how to run individual tests and test collections and remove mention of
tests/scripts/run_tests which does not exist any more.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Mon, 2 Dec 2013 04:39:48 +0000 (15:39 +1100)]
ctdb/tests/scripts: Promote scripts/run_tests
The wrapper is not needed anymore.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Mon, 2 Dec 2013 04:37:18 +0000 (15:37 +1100)]
ctdb/tests/scripts: Simplify the top-level test scripts
At the moment run_tests.sh has quite fragile argument processing. It
needs that annoying "--" between options and tests. The random
default (mktemp -d) for TEST_VAR_DIR is wrong and is worked around in
various places.
Instead:
* Change the default behaviour to print a summary, add new option -N
to turn off summary, and remove old -s option.
* Change the default behaviour to run integration tests with local
daemons, add new options -c to run on a cluster, remove old -l
option.
* Make $testdir/var the default if the tests are not installed, and
$(mktemp -d ) the default if tests are installed.
* Move the default tests for local/cluster into scripts/run_tests.
run_tests.sh (and the run_cluster_tests.sh symlink) should behave as
before but with slightly more reasonable defaults.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Mon, 2 Dec 2013 04:30:29 +0000 (15:30 +1100)]
ctdb/tests/scripts: Sort command-line options
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Fri, 29 Nov 2013 03:07:43 +0000 (14:07 +1100)]
ctdb/tests/integration: Decentralise the daemon restart code
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Fri, 29 Nov 2013 03:05:49 +0000 (14:05 +1100)]
ctdb/tests/integration: Update daemons shutdown pseudo-test
Don't scatter the TEST_LOCAL_DAEMONS logic around the code. Limit it
to the local daemons file.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Thu, 28 Nov 2013 06:27:06 +0000 (17:27 +1100)]
ctdb/tests/simple: Local daemons version of setup_ctdb() overrides
setup_ctdb() doesn't need to do anything on a cluster. To avoid a
conditional, just override it for local daemons.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Thu, 28 Nov 2013 06:26:09 +0000 (17:26 +1100)]
ctdb/tests/integration: Remove some unused functions
This was the start of some refactorisation that was never completed.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Thu, 28 Nov 2013 06:11:03 +0000 (17:11 +1100)]
ctdb/tests/integration: Remove the time logging code
This hasn't been required for a long time and is probably broken. If
it is needed in future then we know where to find it.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Thu, 28 Nov 2013 06:08:43 +0000 (17:08 +1100)]
ctdb/tests/simple: Move the local daemons code to its own file
This is just a straight move. The clever stuff will follow. :-)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Thu, 28 Nov 2013 05:43:55 +0000 (16:43 +1100)]
ctdb/tests/integration: Update NFS tickles test and supporting code
This currently requires an eventscript to be dynamically installed.
This eventscript is only used to help determine when a monitor event
has occurred. This code is horrible and fragile.
A better way is to just monitor the output of "ctdb scriptstatus".
When changes it changes then a monitor event has occurred.
Also remove the old code that checks for tickle information in shared
storage. CTDB hasn't done things this way for a long time.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Christian Ambach [Fri, 22 Nov 2013 04:11:01 +0000 (05:11 +0100)]
lib/replace remove orphaned code
this is not compiled and used anymore
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Dec 4 22:55:12 CET 2013 on sn-devel-104
Christian Ambach [Fri, 22 Nov 2013 04:09:08 +0000 (05:09 +0100)]
s3:utils remove orphaned code
this does not even compile at all.. looks like a real orphan
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Volker Lendecke [Mon, 2 Dec 2013 20:32:47 +0000 (21:32 +0100)]
smbd: Avoid calling notify_filter_string for low debuglevels
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Dec 4 20:09:39 CET 2013 on sn-devel-104
Pavel Reichl [Tue, 3 Dec 2013 14:37:20 +0000 (14:37 +0000)]
ldb: use of NULL pointer bugfix
Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Tue Dec 3 21:13:53 CET 2013 on sn-devel-104
Amitay Isaacs [Fri, 4 Oct 2013 06:10:31 +0000 (16:10 +1000)]
s4-rpc: dnsserver: Ignore duplicate dns zones from multiple locations
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Kai Blin <kai@samba.org>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Sat Nov 30 06:15:52 CET 2013 on sn-devel-104
Amitay Isaacs [Wed, 2 Oct 2013 07:28:45 +0000 (17:28 +1000)]
s4-dns: Ignore duplicate dns zones from multiple locations in dlz_bind9
BIND DLZ module currently loads DNS zones from DNS partitions and domain
partitions using following prefixes:
CN=MicrosoftDNS,DC=DomainDnsZones
CN=MicrosoftDNS,DC=ForestDNSZones
CN=MicrosoftDNS,CN=System
Windows supports DNS zones duplicated in DNS partitions and domain
partition and updates both of them simultaneously.
BIND DLZ module can handle DNS zones stored either in DNS partitions
or domain partition, but not both. This patch ignores duplicate zones
from domain partition and allows BIND9 to work with AD with duplicate
DNS zones.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Kai Blin <kai@samba.org>
Amitay Isaacs [Fri, 2 Aug 2013 08:53:56 +0000 (18:53 +1000)]
netcmd/dns: Catch wildcard patterns when querying for name
DNS query should either be '@' to represent entire zone or a fixed string
and not wildcard search pattern.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Kai Blin <kai@samba.org>
Noel Power [Wed, 16 Oct 2013 15:30:55 +0000 (16:30 +0100)]
fail authentication for single group name which cannot be converted to sid
furthermore if more than one name is supplied and no sid is converted
then also fail.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=8598
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Nov 29 15:45:11 CET 2013 on sn-devel-104
David Disseldorp [Thu, 28 Nov 2013 14:56:58 +0000 (15:56 +0100)]
replace: fix typo in variable name
13550a2b5eed57084a5d9671d9493a9a2e08d7e3 added a typo causing
compilation failure.
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Nov 28 18:16:27 CET 2013 on sn-devel-104
Volker Lendecke [Thu, 28 Nov 2013 08:37:47 +0000 (09:37 +0100)]
pam_winbind: Use strlcat in safe_append_string
We have that available via libreplace, so use it.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Nov 28 14:33:32 CET 2013 on sn-devel-104
Volker Lendecke [Thu, 28 Nov 2013 08:33:59 +0000 (09:33 +0100)]
replace: Don't run over dst in strlcat
If "d" is not 0-terminated, the pure strlen will read beyond the end
of the given bufsize. strlcat in libbsd deliberately avoids this, so we
should do the same.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Michael Adam [Wed, 27 Nov 2013 22:43:53 +0000 (23:43 +0100)]
ctdb:tests: in the stub "ip link show" command use echo instead of cat
This case of "ip link show" does not break autobuild with
"Broken pipe" messages, but let's be consistent.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Nov 28 09:23:03 CET 2013 on sn-devel-104
Amitay Isaacs [Thu, 14 Nov 2013 06:38:29 +0000 (17:38 +1100)]
autobuild: Run ctdb regression tests
Pair-Programmed-with: Michael Adam <obnox@samba.org>
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Michael Adam [Thu, 14 Nov 2013 13:13:01 +0000 (14:13 +0100)]
autobuild: build the "ctdb" target with socket-wrapper enabled
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Michael Adam [Wed, 27 Nov 2013 21:28:06 +0000 (22:28 +0100)]
ctdb:test: remove unused ip2ipmask from integration.bash
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Michael Adam [Wed, 27 Nov 2013 10:42:28 +0000 (11:42 +0100)]
ctdb:tests:76_ctdb_pdb_recovery: change from using ctdb pstore to ctdb ptrans.
This removes the requirement to create a temporary file
and hence makes this test runnable against local daemons
and against a real cluster without further changes.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Michael Adam [Wed, 27 Nov 2013 22:28:24 +0000 (23:28 +0100)]
ctdb:tests:76_ctdb_pdb_recovery: fix a typo in a message
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Michael Adam [Wed, 27 Nov 2013 10:40:53 +0000 (11:40 +0100)]
ctdb:tests:76_ctdb_pdb_recovery: fix a typo in a message
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Michael Adam [Wed, 27 Nov 2013 11:13:40 +0000 (12:13 +0100)]
ctdb:tests: in the stub ip command, avoid broken pipe by using echo instead of cat
This fixes running "make autotest" from autobuild, since
it prevents irritating error output in delete_ip_from_iface()
when calling ip addr list ... | grep -Fq "inet ..." .
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Michael Adam [Thu, 21 Nov 2013 23:35:35 +0000 (00:35 +0100)]
ctdb:tests: ignore SIGPIPE in unit tests
This makes scripts called in the unit tests behave like
when called from ctdbd which ignodes SIGPIPE.
This also makes the scrips behave the same when
called from "make autotest" directly and via autobuild (python).
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Michael Adam [Thu, 21 Nov 2013 08:29:33 +0000 (09:29 +0100)]
ctdb:tests: add path of ip command to extra output in the error case
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Michael Adam [Thu, 21 Nov 2013 07:39:25 +0000 (08:39 +0100)]
ctdb:tests: remove old now unused script test/recover.sh
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Martin Schwenke [Thu, 28 Nov 2013 01:23:57 +0000 (12:23 +1100)]
ctdb:build: Update mkversion.sh to use samba-* tags
To test CTDB on a cluster we need to be able to build test RPMs with
relatively sane version numbers. This is a minimal change to allow
that to happen, until CTDB is integrated into the Samba build system.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Jelmer Vernooij [Sat, 23 Nov 2013 19:46:29 +0000 (19:46 +0000)]
Cope with first element in hdb_method having a different name in different heimdal versions.
It's called `interface_version` in older Heimdal versions and
`version` in newer versions.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Nov 28 04:17:55 CET 2013 on sn-devel-104
Jelmer Vernooij [Sat, 23 Nov 2013 19:46:28 +0000 (19:46 +0000)]
Use heim_octet_string typedef.
The struct version is not provided by newer versions of heimdal.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Jelmer Vernooij [Sat, 23 Nov 2013 19:46:27 +0000 (19:46 +0000)]
Remove no longer used et_deps.pl.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Jelmer Vernooij [Sat, 23 Nov 2013 19:46:26 +0000 (19:46 +0000)]
Remove no longer used asn1_deps.pl.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Jelmer Vernooij [Wed, 27 Nov 2013 02:12:02 +0000 (02:12 +0000)]
Add a basic guide on pytalloc.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Thu Nov 28 02:24:45 CET 2013 on sn-devel-104
Martin Schwenke [Thu, 21 Nov 2013 05:38:43 +0000 (16:38 +1100)]
ctdb:tests/simple: Nobody looks at /tmp/recloop.out so use /dev/null instead
Otherwise this should use mktemp, something should look at the output
and the file should be removed. :-)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Nov 27 20:39:00 CET 2013 on sn-devel-104
Martin Schwenke [Thu, 21 Nov 2013 05:22:52 +0000 (16:22 +1100)]
ctdb:tests: run_tests should ignore bogus test directories
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Thu, 14 Nov 2013 09:34:50 +0000 (20:34 +1100)]
ctdb:tests: New "autotest" Makefile.in target
This needs to run with socket wrapper and needs to stop after the 1st
error.
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Thu, 21 Nov 2013 04:38:06 +0000 (15:38 +1100)]
ctdb:tests: Add -S option to support socket wrapper
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Fri, 15 Nov 2013 01:22:05 +0000 (12:22 +1100)]
ctdb:tests: Rework unit test result filtering
Using a variable is too fragile, so use a function instead.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Fri, 15 Nov 2013 01:22:05 +0000 (12:22 +1100)]
ctdb:tests: remove unused setup_nmap_output_filter()
The tests that used it have gone.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Thu, 14 Nov 2013 09:36:52 +0000 (20:36 +1100)]
ctdb:tests/integration: Be more careful when killing ctdbd
Also match $TEST_VAR_DIR in the socket name. This means that we'll
only ever kill ctdbd process belong to our own test run.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Mon, 25 Nov 2013 08:28:10 +0000 (19:28 +1100)]
ctdb: Update NEWS
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Tue, 26 Nov 2013 04:41:50 +0000 (15:41 +1100)]
ctdb-scripts: Be careful when generating unique pids for stack traces
sort expects the data to be line based, so make it so.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Tue, 26 Nov 2013 03:38:58 +0000 (14:38 +1100)]
ctdb-config: Simplify the default CTDB configuration file
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-with: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Tue, 26 Nov 2013 03:29:52 +0000 (14:29 +1100)]
ctdb-scripts: Replace hard-coded /var/ctdb with CTDB_VARDIR
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Tue, 26 Nov 2013 02:27:46 +0000 (13:27 +1100)]
ctdb-scripts: Set defaults for CTDB_DBDIR and CTDB_DBDIR_PERSISTENT
If these configuration variables are not defined, then there should
a default fallback. This is a workaround till CTDB compile time
configuration can be accessed at runtime.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Tue, 26 Nov 2013 00:39:54 +0000 (11:39 +1100)]
ctdb-eventscripts: Perform share check before NFS RPC checks in 60.ganesha
If NFS RPC checks do restart Ganesha, then it's possible that share
check can fail prematurely.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Fri, 22 Nov 2013 02:57:31 +0000 (13:57 +1100)]
ctdb-tools/ctdb: Improve error checking when parsing node string
If a node isn't numeric then it is silently converted to 0.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Fri, 22 Nov 2013 02:57:03 +0000 (13:57 +1100)]
ctdb-recoverd: Only respond to currently queued ipreallocated requests
Otherwise new requests can come in during the latter parts of the
takeover run when the IP allocation algorithm has already run, and the
new requests will be dequeued even though they haven't really be
processed.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Tue, 19 Nov 2013 04:40:08 +0000 (15:40 +1100)]
ctdb-scripts: Add an early exit to statd-callout's notify case
If $statd_state is empty then the loop will run once and print
spurious errors.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Tue, 19 Nov 2013 04:37:58 +0000 (15:37 +1100)]
ctdb-eventscripts: Remove the nfs_statd_update() call from 60.ganesha
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Mon, 18 Nov 2013 10:04:49 +0000 (21:04 +1100)]
ctdb-tests/integration: Neaten up some of the persistent database tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Mon, 18 Nov 2013 04:09:27 +0000 (15:09 +1100)]
ctdb-tools/ctdb: Fix tstore command to generate ltdb header internally
This fixes an alignment discrepancy on 32-bit vs 64-bit platforms.
sizeof(struct ctdb_ltdb_header) = 20 (32-bit)
= 24 (64-bit)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Fri, 15 Nov 2013 04:31:03 +0000 (15:31 +1100)]
ctdb-tests/takeover: Fix bogus test description
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Fri, 15 Nov 2013 04:23:14 +0000 (15:23 +1100)]
ctdb-tests/simple: User sleep_for() instead of sleep
Progress...
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Fri, 15 Nov 2013 04:21:58 +0000 (15:21 +1100)]
ctdb-tests/simple: Update persistent DB tests
* Low level DB checks should ignore the sequence number record.
* A restart is needed after messing with the RecoverPDBBySeqNum
tunable.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Fri, 15 Nov 2013 04:20:40 +0000 (15:20 +1100)]
ctdb-recoverd: For persistent databases a sequence number of 0 is valid
Otherwise recovery ends up done by RSN when it is unnecessary.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Tue, 19 Nov 2013 04:31:39 +0000 (15:31 +1100)]
ctdb-locking: Use vfork instead of fork to exec helpers
There is a significant overhead using fork() over vfork(), specially
when the child process execs a helper. The overhead is in memory space
and time.
# strace -c ./test_fork 1024 200
count=1024, size=204800, total=200M
failed fork=0
time for fork() = 4879.597000 us
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00 4.543321 3304 1375 375 clone
0.00 0.000071 0 1033 mmap
0.00 0.000000 0 1 read
0.00 0.000000 0 3 write
0.00 0.000000 0 2 open
0.00 0.000000 0 2 close
0.00 0.000000 0 3 fstat
0.00 0.000000 0 3 mprotect
0.00 0.000000 0 1 munmap
0.00 0.000000 0 3 brk
0.00 0.000000 0 1 1 access
0.00 0.000000 0 1 execve
0.00 0.000000 0 1 arch_prctl
------ ----------- ----------- --------- --------- ----------------
100.00 4.543392 2429 376 total
# strace -c ./test_vfork 1024 200
count=1024, size=204800, total=200M
failed fork=0
time for fork() = 82.041000 us
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
96.47 0.001204 1 1000 vfork
3.53 0.000044 0 1033 mmap
0.00 0.000000 0 1 read
0.00 0.000000 0 3 write
0.00 0.000000 0 2 open
0.00 0.000000 0 2 close
0.00 0.000000 0 3 fstat
0.00 0.000000 0 3 mprotect
0.00 0.000000 0 1 munmap
0.00 0.000000 0 3 brk
0.00 0.000000 0 1 1 access
0.00 0.000000 0 1 execve
0.00 0.000000 0 1 arch_prctl
------ ----------- ----------- --------- --------- ----------------
100.00 0.001248 2054 1 total
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Tue, 19 Nov 2013 05:13:20 +0000 (16:13 +1100)]
ctdb-common: Refactor code to keep track of child processes
This code can then be used to track child processes created with vfork().
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Fri, 15 Nov 2013 07:59:04 +0000 (18:59 +1100)]
ctdb-scripts: Run a single instance of debug_locks.sh at a give time
This prevents spamming of logs if multiple lock requests are waiting
and keep timing out.
Also, improve the logging format with separators.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Fri, 15 Nov 2013 07:36:09 +0000 (18:36 +1100)]
ctdb-locking: Update current lock statistics when lock is scheduled
When a child process is created for a lock request, the current locks
statistics should be updated immediately. This will provide accurate
information on number of active lock requests.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Mon, 18 Nov 2013 04:48:22 +0000 (15:48 +1100)]
ctdb-locking: Do not merge multiple lock requests to avoid unfair scheduling
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Fri, 15 Nov 2013 04:58:59 +0000 (15:58 +1100)]
ctdb-locking: Implement active lock requests limit per database
This limit was currently a global limit and not per database. This
prevents any database freeze lock requests from getting scheduled if
the global limit was reached.
Only individual record requests should be limited and database freeze
requests should always get scheduled.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Fri, 8 Nov 2013 05:41:11 +0000 (16:41 +1100)]
ctdb-scripts: Rewrite statd-callout to avoid 10 minute lag
This is naive and assumes no performance problems when updating
persistent DBs. It also does no error handling.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Amitay Isaacs [Wed, 13 Nov 2013 06:45:25 +0000 (17:45 +1100)]
ctdb-client: Treat empty __db_sequence_number__ record as 0
This fixes the issue of transaction commit failing due to an empty
__db_sequence_number__ record in persistent database left by previous
cancelled transaction.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Martin Schwenke [Wed, 13 Nov 2013 05:19:00 +0000 (16:19 +1100)]
ctdb-doc: Update ctdb.1 - primarily to add pdelete/pfetch/pstore/ptrans
Also:
* More <refentryinfo> above <refmeta> to make the XML valid.
* Describe DB argument in introduction and use it for database
commands.
* Remove unnecessary format="linespecific" from <screen> tags, since
it will not be allowed in DocBook 5.0.
* Sort the items in "INTERNAL COMMANDS".
* Update/simplify some command descriptions.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>