kai/samba-autobuild/.git
12 years agoRECOVER: When we pull databases during recovery, we used to reallocate the databuffer...
Ronnie Sahlberg [Fri, 25 May 2012 02:27:59 +0000 (12:27 +1000)]
RECOVER: When we pull databases during recovery, we used to reallocate the databuffer for each entry added. This would normally not be an issue, but for cases where memory is fragmented, this could start to cost significant cpu if we need to reallocate and move to a different region.

Change this to instead preallocate , by default, 10MByte chunks to the data buffer.
This significantly reduces the number of potential reallocate and move  operations that may be required.

Create a tunable to override/change how much preallocation should be used.

(This used to be ctdb commit 1f262deaad0818f159f9c68330f7fec121679023)

12 years agoDOCS: Document the new tunables to produce warnings if databases grow unexpectedly...
Ronnie Sahlberg [Mon, 21 May 2012 04:01:04 +0000 (14:01 +1000)]
DOCS: Document the new tunables to produce warnings if databases grow unexpectedly big.

(This used to be ctdb commit 6cf6a9b071bd8dd730717ca033337ff73bf247bb)

12 years agoDEBUG: Add checks for and print debug messages when 1) a database contains very many...
Ronnie Sahlberg [Mon, 21 May 2012 03:11:38 +0000 (13:11 +1000)]
DEBUG: Add checks for and print debug messages when 1) a database contains very many records, 2) when a database is very big, 3) when a single record is very big.

Add tunables to control when to log these instances and allow it to be completely turned off by setting the threshold to 0

(This used to be ctdb commit 9ed58fef4991725f75509433496f4d5ffae0ae87)

12 years agoTEVENT: Add back tracking of long runnig events to the local copy of tevent library
Ronnie Sahlberg [Sun, 20 May 2012 23:17:05 +0000 (09:17 +1000)]
TEVENT: Add back tracking of long runnig  events to the local copy of tevent library

(This used to be ctdb commit 5aba53e6adcfcd7edbdac9e30aa5fcba176aca00)

12 years agoGANESHA: make the ganesha script executable by default
Ronnie Sahlberg [Thu, 17 May 2012 01:16:57 +0000 (11:16 +1000)]
GANESHA: make the ganesha script executable by default

(This used to be ctdb commit f59b40b3f8ea3da8ffb8601bc025e83c237072d5)

12 years agoMerge remote branch 'martins/ganesha'
Ronnie Sahlberg [Thu, 17 May 2012 01:48:07 +0000 (11:48 +1000)]
Merge remote branch 'martins/ganesha'

(This used to be ctdb commit f23b5a160184db8c92f8c69307dc4a64adae839d)

12 years agoDebug: When scripts hang, we may need to collect additional data in order to debug...
Ronnie Sahlberg [Thu, 17 May 2012 00:17:51 +0000 (10:17 +1000)]
Debug: When scripts hang, we may need to collect additional data in order to debug why the script hung.

Break this debug and datacollection out into an external script to make it easier to modify what data we need to collect.
For now we only collect a pstree so we can see what part of the script we hung in.

S1037271

(This used to be ctdb commit 6e68797af67bee36f2bad045f94806e7e98f27e9)

12 years agoEventscripts: Modernise 60.ganesha to match 60.nfs
Martin Schwenke [Wed, 16 May 2012 07:24:21 +0000 (17:24 +1000)]
Eventscripts: Modernise 60.ganesha to match 60.nfs

Originally from Srikrishan Malik <srikrishan.malik@in.ibm.com> with
some style changes by me.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 637cab6304dae66b85668506028c76ea1ee88980)

12 years agoEventscripts: restart lockd in the background when going unhealthy
Martin Schwenke [Wed, 16 May 2012 03:29:58 +0000 (13:29 +1000)]
Eventscripts: restart lockd in the background when going unhealthy

Sometimes the restart can hang when there are I/O problems.  Then the
eventscript times out and gets killed so the node never marked as
unhealthy.

Restarting in the background avoids this.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 13acd58c41fba1a33894fbd654fed69ea0eac322)

12 years agoEventscript functions: add optional version to nfs_check_rpc_service()
Martin Schwenke [Tue, 8 May 2012 04:53:58 +0000 (14:53 +1000)]
Eventscript functions: add optional version to nfs_check_rpc_service()

This can be optional because the 1st item of each action-triple is a
test comparison that starts with '-'.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 92f74fd589467b46c758e116e97417edfe8773d7)

12 years agotests: Move the "ctdb reloadips" test from complex/ to simple/
Martin Schwenke [Mon, 14 May 2012 05:11:14 +0000 (15:11 +1000)]
tests: Move the "ctdb reloadips" test from complex/ to simple/

This is made possible by separation of public addresses files for
local daemons and the addition of get_ctdbd_command_line_option().

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 2bcd58b30d7cf6dd48ad7f019810c6965a44c85a)

12 years agotests: Fix a typo in daemons_setup()
Martin Schwenke [Mon, 14 May 2012 05:01:44 +0000 (15:01 +1000)]
tests: Fix a typo in daemons_setup()

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 863ad337fa3c4effe1fd370d3ba414027c600bd6)

12 years agotests: New function get_ctdbd_command_line_option() for integration testing
Martin Schwenke [Mon, 14 May 2012 05:00:32 +0000 (15:00 +1000)]
tests: New function get_ctdbd_command_line_option() for integration testing

This allows, for example, the public addresses file used by a
particular daemon to be known.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit f4b7d14f2e3c7345e7a09abb27c32923fb78cbc4)

12 years agotests: Use per-daemon public_addresses file for local daemons
Martin Schwenke [Mon, 14 May 2012 04:59:22 +0000 (14:59 +1000)]
tests: Use per-daemon public_addresses file for local daemons

This allows a node's public addresses file to be hacked for testing.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit c7d6e4557d00de674737e2c8d6cbebaa2461c303)

12 years agotests: Restore the old behaviour of "make test" so it uses tests/var
Martin Schwenke [Mon, 14 May 2012 02:47:02 +0000 (12:47 +1000)]
tests: Restore the old behaviour of "make test" so it uses tests/var

This is finally possible, given all the other changes...  :-)

This is a good default because daemons will be left running, test/var
will still exist and test failures can be investigated.

To "automatically" clean up, do:

  ./tests/run_tests.sh -C -V tests/var -- tests/simple/99_daemons_shutdown.sh

... although "killall ctdbd ; rm -rf tests/var" is less keystrokes.  ;-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit d661f09c6c76543bd091d51bc0e6fe97ed0f55d1)

12 years agotests: Fix wrapper scripts to handle options and tests without breakage
Martin Schwenke [Mon, 14 May 2012 01:57:20 +0000 (11:57 +1000)]
tests: Fix wrapper scripts to handle options and tests without breakage

If the -V option is given and no tests are supplied, the "cd" command
in run_tests.sh cause scripts/run_tests to interpret the argument to
-V incorrectly.  Therefore, the wrapper scripts can't use "cd" because
they don't know what the options are doing!

Instead scripts/run_tests searches for each test relative to the
current directory and, if not previously found, then searches relative
to the top-level tests directory.  This is a much better way of doing
things.

Given that run_tests.sh and run_cluster_tests.sh were starting to
contain duplicate complex logic, remove run_cluster_tests.sh and
replace it with a symlink to run_tests.sh.  Run_tests.sh checks $0 to
see what options/defaults to use.  Update INSTALL to deal with this.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit ed2db1f4e8d2b222d7f912a4a007ce48a23e83b0)

12 years agotests: Add a test for "ctdb reloadips"
Martin Schwenke [Fri, 11 May 2012 02:13:24 +0000 (12:13 +1000)]
tests: Add a test for "ctdb reloadips"

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit d2514051761ba23deee0e118c25afab2ab8d854e)

12 years agotests: In integration tests, use --node-ip to avoid locking weirdness
Martin Schwenke [Thu, 10 May 2012 06:58:16 +0000 (16:58 +1000)]
tests: In integration tests, use --node-ip to avoid locking weirdness

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a00e80c701a0f9695f41c24e0360c25c0873d49d)

12 years agotests: Allow run_cluster_tests.sh to take options
Martin Schwenke [Thu, 10 May 2012 06:17:44 +0000 (16:17 +1000)]
tests: Allow run_cluster_tests.sh to take options

However, options must be followed by "--".

This also fixes:

* a bug where specifying tests caused local daemons to be used; and
* an incorrect comment.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 6b8507d4d3062e709409b3790117d87311b3460d)

12 years agotests: Allow run_tests.sh to take options
Martin Schwenke [Thu, 10 May 2012 04:55:19 +0000 (14:55 +1000)]
tests: Allow run_tests.sh to take options

However, options must be followed by "--".

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit db8cf8f5e644a0b21a6040287887fee40f38d4db)

12 years agotests/eventscripts: Fix a policy routing test
Martin Schwenke [Thu, 10 May 2012 04:32:06 +0000 (14:32 +1000)]
tests/eventscripts: Fix a policy routing test

The previous commit 55006ea8999ab3721fcde81b92692661065f0688
highlighted an error in this test.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 9f20fbf91706db94f65f62dbd6a4e087890c1da9)

12 years agotests/eventscripts: $CTDB_BASE needs to be in $TEST_VAR_DIR
Martin Schwenke [Thu, 10 May 2012 04:16:45 +0000 (14:16 +1000)]
tests/eventscripts: $CTDB_BASE needs to be in $TEST_VAR_DIR

The policy routing tests write the configuration file into $CTDB_BASE,
as per rcommended practice.  Unless this is in $TEST_VAR_DIR this
won't work sensible when the tests are installed.

Things are done slightly different than for /etc.  Here we use
symlinks and we want them to be dereferenced.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 61c80f58a8cfbaca7e669ef8cd95b4f6b5dc66c7)

12 years agoPackaging: Improve dependencies
Martin Schwenke [Wed, 9 May 2012 07:20:27 +0000 (17:20 +1000)]
Packaging: Improve dependencies

We don't strictly need gawk (i.e. could probably use nawk), but that
seems to provide /bin/awk on RHEL.

PreReq seems old-school.  We don't have an scriptlets, so nothing
needs to be installed before CTDB.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit e7ba0a30e7b7fe78e83e493128b349708cf0038a)

12 years agoPackaging: add options to ctdb.spec.in to force use of bundled libraries
Martin Schwenke [Wed, 9 May 2012 06:03:00 +0000 (16:03 +1000)]
Packaging: add options to ctdb.spec.in to force use of bundled libraries

Ideas borrowed from the Fedora samba4 spec file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 14a630cbc638d2f3bf699de5d94131e5f7d1a3ea)

12 years agoEventscript functions: add optional version to nfs_check_rpc_service()
Martin Schwenke [Tue, 8 May 2012 04:53:58 +0000 (14:53 +1000)]
Eventscript functions: add optional version to nfs_check_rpc_service()

This can be optional because the 1st item of each action-triple is a
test comparison that starts with '-'.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 1957d53b78f101cd0cd37d9705a225deef5174a2)

12 years agoPackaging: devel package fixes
Martin Schwenke [Fri, 11 May 2012 00:32:26 +0000 (10:32 +1000)]
Packaging: devel package fixes

Group was non-existent, typo in summary.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit f0a14169883661a702a352aa0311a2b433071a83)

12 years agoPackaging: generate a ctdb-tests package
Martin Schwenke [Thu, 3 May 2012 02:12:53 +0000 (12:12 +1000)]
Packaging: generate a ctdb-tests package

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 5c23244591b8005f91d8e25e719cd332c711db14)

12 years agoWe dont need to serialize the "probe which address this node is" if we have given...
Ronnie Sahlberg [Thu, 10 May 2012 07:40:22 +0000 (17:40 +1000)]
We dont need to serialize the "probe which address this node is" if we have given an explicit --node-ip on the commandline

(This used to be ctdb commit e3dc5bd3f1ef1f0ed08f57a5b5bafcac936e9ed0)

12 years agoTrack all child process so we never send a signal to an unrelated process (our child...
Ronnie Sahlberg [Thu, 3 May 2012 01:42:41 +0000 (11:42 +1000)]
Track all child process so we never send a signal to an unrelated process (our child died  and kernel wrapped the pid-space and reused the pid for a different process

Wrap all creation of child processes inside ctdb_fork() which is used to track all processes we have spawned.
Capture SIGCHLD to track also which child processes have terminated.

Wrap kill() inside ctdb_kill() and make sure that we never send a !0 signal to a child process pid that has already terminated (and might have been replaced with a

(This used to be ctdb commit f73a4b1495830bcdd094a93732a89dd53b3c2f78)

12 years agoDOC: document the reloadips command
Ronnie Sahlberg [Thu, 3 May 2012 01:06:55 +0000 (11:06 +1000)]
DOC: document the reloadips command

(This used to be ctdb commit 90e8c4dc7d89c460ad2da5a9af1cef006db3b1c0)

12 years agoRELOADIPS: simplify the reloadips code a bit
Ronnie Sahlberg [Tue, 1 May 2012 05:27:12 +0000 (15:27 +1000)]
RELOADIPS: simplify the reloadips code a bit
and also update the "read public address file" to not check if the address exists already locally when we read if from the child process, to stop it
from spamming the logs with "We already host ..."
messages

(This used to be ctdb commit 334ea830f1bf33419f4a1e78f23afd41a852d0f4)

12 years agoRevert "server: locking: Provide a common API for non-blocking locking of TDBs"
Amitay Isaacs [Tue, 1 May 2012 02:09:48 +0000 (12:09 +1000)]
Revert "server: locking: Provide a common API for non-blocking locking of TDBs"

This reverts commit 6a92fc2b8da2bba98dca29b781ab459ba4e879a5.

Reverting incomplete changes to ctdb_lock.c

(This used to be ctdb commit 2a3d22431948f849c93762a6ab49344acb687feb)

12 years agoserver: locking: Provide a common API for non-blocking locking of TDBs
Amitay Isaacs [Thu, 26 Apr 2012 05:48:12 +0000 (15:48 +1000)]
server: locking: Provide a common API for non-blocking locking of TDBs

(This used to be ctdb commit 6a92fc2b8da2bba98dca29b781ab459ba4e879a5)

12 years agotests/simple: Fix typo in the test message
Amitay Isaacs [Mon, 23 Apr 2012 05:53:29 +0000 (15:53 +1000)]
tests/simple: Fix typo in the test message

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit c642b452e7b0272e32c02509ac579b790d9a03e7)

12 years agoAdd new control to reload the public ip address file on a node
Ronnie Sahlberg [Mon, 30 Apr 2012 05:50:44 +0000 (15:50 +1000)]
Add new control to reload the public ip address file on a node

Also add a method to use the recovery master/daemon to reload the public ips on all nodes in the cluster.
Reloading the public ips on all node sin the cluster is only suported if all nodes in the cluster are available and healthy.

(This used to be ctdb commit 05603e914f8c12618d7e06943c0f7df207f645b0)

12 years agotests: Update README
Martin Schwenke [Fri, 27 Apr 2012 07:19:45 +0000 (17:19 +1000)]
tests: Update README

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit e9fad1ff82e6fb9e6bf615986c41c746fd415058)

12 years agotests/eventscripts: $CTDB_ETCDIR should be in $TEST_VAR_DIR
Martin Schwenke [Fri, 27 Apr 2012 04:17:52 +0000 (14:17 +1000)]
tests/eventscripts: $CTDB_ETCDIR should be in $TEST_VAR_DIR

The policy routing tests modify /etc/iproute2/rt_tables, so this
directory should not be in the installation area.

Instead the contents of tests/eventscripts/etc are copied into a place
under $TEST_VAR_DIR where the directory can be modified with gay
abandon.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a0afb4195caab39891a304b8b4eadd94cab7c4a7)

12 years agotests/eventscripts: Use a canned ctdb.sysconfig rather than a link
Martin Schwenke [Fri, 27 Apr 2012 04:16:16 +0000 (14:16 +1000)]
tests/eventscripts: Use a canned ctdb.sysconfig rather than a link

The link is hard to manage and has no real advantage.

The canned config is 2 of the 3 currently non-comment/whitespace lines
in config/ctdb.sysconfig.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 66d0b913301c3b1037278bcaa0452ecbe07248df)

12 years agotests/eventscripts: Explicitly set CTDB_SERVICE_AUTOSTARTSTOP="yes"
Martin Schwenke [Fri, 27 Apr 2012 04:15:06 +0000 (14:15 +1000)]
tests/eventscripts: Explicitly set CTDB_SERVICE_AUTOSTARTSTOP="yes"

No use depending on defaults in the initscript - the tests should
control what is tested.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 1c37abac5fd18c139aa55989d0fb6b475f4c22f1)

12 years agotests/eventscripts: Be more defensive about removing the var directory
Martin Schwenke [Tue, 24 Apr 2012 07:17:59 +0000 (17:17 +1000)]
tests/eventscripts: Be more defensive about removing the var directory

Could add -r but that might avoid error.  The only time it doesn't
exist is the 1st time a top-level var directory is used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 047d97dc84a5943556efb31bb2856fd04835fffa)

12 years agoEventscripts: fix basename -> dirname typo
Martin Schwenke [Tue, 24 Apr 2012 07:17:07 +0000 (17:17 +1000)]
Eventscripts: fix basename -> dirname typo

I fixed one of these previously but didn't notice this one...  :-(

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 0c674efd19368d41d9cc28909d2b16c1af54c86c)

12 years agotests/eventscripts: Add sanity check to esnure events.d/ can be found
Martin Schwenke [Tue, 24 Apr 2012 06:59:38 +0000 (16:59 +1000)]
tests/eventscripts: Add sanity check to esnure events.d/ can be found

If it can't, the installation is probably inconsistent, so a
(hopefully) helpful message is printed.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit df732ca8e27f0f3417b4d5d259157bd0e0632124)

12 years agotests: Add installation script for tests
Martin Schwenke [Tue, 24 Apr 2012 06:28:15 +0000 (16:28 +1000)]
tests: Add installation script for tests

This could all be done in Makefile.in, but that would be very complex.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 12c9986059cacda819e669fa77d613b408c62599)

12 years agotests/simple: Add new pseudo testcase to potentially shutdown local daemons
Martin Schwenke [Tue, 24 Apr 2012 04:40:52 +0000 (14:40 +1000)]
tests/simple: Add new pseudo testcase to potentially shutdown local daemons

Only shuts them down if $TEST_CLEANUP is true.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit eddfc02335202d853e29a89f08225ab44cac8a25)

12 years agotests: New run_tests -C (cleanup) option
Martin Schwenke [Tue, 24 Apr 2012 04:39:24 +0000 (14:39 +1000)]
tests: New run_tests -C (cleanup) option

Sets TEST_CLEANUP=true and causes $TEST_VAR_DIR to be removed... and
potentially other cleanup actions in testcases.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 3219f221a858e499f084b8beb44610537312602b)

12 years agotests/eventscripts: $FAKE_IP_STATE is always set in ip command stub
Martin Schwenke [Tue, 24 Apr 2012 04:04:36 +0000 (14:04 +1000)]
tests/eventscripts: $FAKE_IP_STATE is always set in ip command stub

No need for a default, especially since there is no sane default!

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit b430a5f61cfdc28e967890602ce6dac0e922c07d)

12 years agotests: Time logging in integration tests should use TEST_VAR_DIR
Martin Schwenke [Tue, 24 Apr 2012 04:03:41 +0000 (14:03 +1000)]
tests: Time logging in integration tests should use TEST_VAR_DIR

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 734cbd7def23236d418ebc6d813a748a84900101)

12 years agotests: Unit tests should use $TEST_VAR_DIR
Martin Schwenke [Tue, 24 Apr 2012 04:02:28 +0000 (14:02 +1000)]
tests: Unit tests should use $TEST_VAR_DIR

This directory is already guaranteed to be absolute, so no check is
needed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 78f6f209eb15102f4e8baa9106583df0ef4bb693)

12 years agotests: Improve the logic for adding directories to $PATH
Martin Schwenke [Tue, 24 Apr 2012 01:50:36 +0000 (11:50 +1000)]
tests: Improve the logic for adding directories to $PATH

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit e6bfd3bdb3a35b2e7e7c41a6f37976772a54e3ce)

12 years agotests: Update integration.sh to use TEST_VAR_DIR
Martin Schwenke [Tue, 24 Apr 2012 01:39:07 +0000 (11:39 +1000)]
tests: Update integration.sh to use TEST_VAR_DIR

There are 2 subtleties:

* Local daemons currently use the in-tree tests/events.d/ subdirectory
  for their eventscripts.  However, some tests install/remove test-specific
  eventscripts so now $TEST_VAR_DIR/events.d/ is used and the standard
  eventscripts are copied there at setup time.

* The pgrep/pkill logic for killing local daemons currently relies on
  ctdbd being run with a full path to tests/bin/ctdbd.  If the tests
  are installed and run against an installed daemon then this won't
  work.  Therefore, ctdbd is now expected to be in $PATH and is
  found/killed by matching:

    ctdbd --socket=.* --nlist .* --nopublicipcheck

  This is complex but should avoid killing a real ctdbd running on a
  node.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 301491802eec0e49e108f5aae7d7be379703d72c)

12 years agotests: Add a -V option to set new variable TEST_VAR_DIR
Martin Schwenke [Tue, 24 Apr 2012 00:25:50 +0000 (10:25 +1000)]
tests: Add a -V option to set new variable TEST_VAR_DIR

Part of preparation to be able to install the tests.  The current var/
subdirectories will end up somewhere in /usr/local/ or /usr/ and we
don't want to put temporary files there.

This creates a temporary TEST_VAR_DIR by default.

If -V is specified then the given directory will be used as
TEST_VAR_DIR.  This allows the current behaviour where individual
integration tests can be run against already-running daemons 9with
sockets and other stuff already created) to save time and trouble.

Yes, there are plans for a clean-up option...  ;-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 8e4ec9a40bb7d392d7474b067a74fa121c069007)

12 years agotests/integration: Remove cabability for testcase option
Martin Schwenke [Tue, 24 Apr 2012 00:23:17 +0000 (10:23 +1000)]
tests/integration: Remove cabability for testcase option

This is unused and can't be used with the current test infrastructure.
It may have been useful with ctdb_test_env but I don't think it was
ever used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 4aa879466dd46cb4e8710edbbaac1276521e475b)

12 years agotests/integration: Use absolute path for socket symlink
Martin Schwenke [Mon, 23 Apr 2012 04:45:04 +0000 (14:45 +1000)]
tests/integration: Use absolute path for socket symlink

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 709cd5dfeb630096a1cd2062da666fee9ddca715)

12 years agotests/simple: Replace "tdbdump" with "ctdb cattdb"
Martin Schwenke [Mon, 23 Apr 2012 04:40:28 +0000 (14:40 +1000)]
tests/simple: Replace "tdbdump" with "ctdb cattdb"

tdbdump may not be installed and would be an unnecessary dependency.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit fbabc05569d91bf033f474d89f51b49490943332)

12 years agotests: Make run_tests -X more flexible - it now works with onnode
Martin Schwenke [Fri, 20 Apr 2012 06:43:17 +0000 (16:43 +1000)]
tests: Make run_tests -X more flexible - it now works with onnode

Hardcoding "sh -x" is suboptimal because some scripts, like onnode,
require bash.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 246809af64c03d26288abff5907ed46614e72b15)

12 years agotests: Update README files and add new README files where missing
Martin Schwenke [Fri, 20 Apr 2012 06:37:09 +0000 (16:37 +1000)]
tests: Update README files and add new README files where missing

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit bef03b32f8ec114a64c55b25951aeeb939d87b33)

12 years agotests: Update top-level wrapper scripts
Martin Schwenke [Fri, 20 Apr 2012 04:10:34 +0000 (14:10 +1000)]
tests: Update top-level wrapper scripts

* Add the unit tests to "make test"
* Make scripts run from anywhere

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 95947123eee687ed83eebc567397a5bc9d55a945)

12 years agotests: run_tests should exit with failed test status if running with -H
Martin Schwenke [Fri, 20 Apr 2012 04:09:43 +0000 (14:09 +1000)]
tests: run_tests should exit with failed test status if running with -H

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 6eb7fa572e7fc212332ddd68793e3f35161baf7c)

12 years agotests: test_wrap can use $TEST_SCRIPTS_DIR for a little extra clarity
Martin Schwenke [Fri, 20 Apr 2012 03:57:01 +0000 (13:57 +1000)]
tests: test_wrap can use $TEST_SCRIPTS_DIR for a little extra clarity

Also add a comment to explain what is being added to $PATH.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 704a3e3b83aff63e8f7b0650c141776ed2c1f047)

12 years agotests: test_wrap needs to set TEST_SCRIPTS_DIR
Amitay Isaacs [Thu, 19 Apr 2012 05:40:53 +0000 (15:40 +1000)]
tests: test_wrap needs to set TEST_SCRIPTS_DIR

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 79e979d67e3a2a5a13ef8fd2ef8f56331ec51558)

12 years agotests: CTDB_TEST_WRAPPER has to be an absolute path on a real cluster
Amitay Isaacs [Thu, 19 Apr 2012 05:33:46 +0000 (15:33 +1000)]
tests: CTDB_TEST_WRAPPER has to be an absolute path on a real cluster

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit a0a7759d47ef5de4a8214273e39c50fb1f6e2e0c)

12 years agotests: Fix wrapper scripts
Amitay Isaacs [Thu, 19 Apr 2012 05:18:49 +0000 (15:18 +1000)]
tests: Fix wrapper scripts

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit eef162ceaac6853bf1ff622691901289280bc25f)

12 years agotests: Fix trailing whitespace issues in integration.bash
Martin Schwenke [Thu, 19 Apr 2012 02:19:02 +0000 (12:19 +1000)]
tests: Fix trailing whitespace issues in integration.bash

git complains...

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit d714cf7924674a7a0eb6d585eb74a6a4df26fc12)

12 years agotests: Add new -H option for run_tests to avoid printing header/footer
Martin Schwenke [Thu, 19 Apr 2012 02:10:25 +0000 (12:10 +1000)]
tests: Add new -H option for run_tests to avoid printing header/footer

This is useful for using run_tests to run one test at a time within an
alternative test framework.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit dc71294a33e88baa4e85fa1fa66cab58a83c2607)

12 years agotests: Add -e option to cause run_tests to exit on first test failure
Martin Schwenke [Thu, 19 Apr 2012 01:50:32 +0000 (11:50 +1000)]
tests: Add -e option to cause run_tests to exit on first test failure

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit f45295a3005474957852d0e7a5c3807e30ab519d)

12 years agotests: Remove ctdb_test_env
Martin Schwenke [Thu, 19 Apr 2012 01:31:02 +0000 (11:31 +1000)]
tests: Remove ctdb_test_env

Move the contents to integration.bash and run_tests as appropriate.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 6136ab02db261b26a2a58b526c913e37e8146841)

12 years agotests: Programs run by tests should be found in $PATH
Martin Schwenke [Thu, 19 Apr 2012 01:27:05 +0000 (11:27 +1000)]
tests: Programs run by tests should be found in $PATH

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit b5308142d03332d6d4e0c3b77283c772462fbb23)

12 years agotests: Move relative directory path hack from run_tests to common.sh
Martin Schwenke [Thu, 19 Apr 2012 01:23:07 +0000 (11:23 +1000)]
tests: Move relative directory path hack from run_tests to common.sh

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 66a7fece867966528689d2784a284e32d687a0f5)

12 years agotests: Local daemons are no longer the default, now require run_tests -l
Martin Schwenke [Thu, 19 Apr 2012 01:14:28 +0000 (11:14 +1000)]
tests: Local daemons are no longer the default, now require run_tests -l

Testing with local daemons is the current default but this is not the
most common use case.  Therefore, we make local daemons optional by
using the -l switch with run_tests or by setting TEST_LOCAL_DAEMONS to
the number of daemons to be used (-l sets this to 3).

TEST_LOCAL_DAEMONS replaces CTDB_TEST_NUM_DAEMONS and
CTDB_TEST_REAL_CLUSTER is removed.

Most relevant logic is moved from ctdb_test_env to integration.bash.
ctdb_test_check_real_cluster() is moved from integration.bash to
complex/scripts/local.bash.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 72ecae61c43b318ec94b527a12cbb0a382e8c3db)

12 years agoEventscripts - Fix typo in 13.per_ip_routing support for __auto_link_local__
Martin Schwenke [Wed, 18 Apr 2012 06:49:48 +0000 (16:49 +1000)]
Eventscripts - Fix typo in 13.per_ip_routing support for __auto_link_local__

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 9542e770a9780740b49122f1f52f08b32eca4b35)

12 years agotests: Rationalise integration test infrastructure
Martin Schwenke [Wed, 18 Apr 2012 05:04:50 +0000 (15:04 +1000)]
tests: Rationalise integration test infrastructure

* run_tests no longer includes common.sh, which is only to be included
  by test cases.  Therefore, it defines its own die() function.

* TEST_SUBDIR is now set in common.sh

* Move complex-only functions to complex/scripts/local.bash

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit bfa1d6638d3e116640eb4e3bb71b21ba6ef8cae5)

12 years agotests: Rename ctdb_test_functions.bash to integration.bash
Martin Schwenke [Wed, 18 Apr 2012 04:55:21 +0000 (14:55 +1000)]
tests: Rename ctdb_test_functions.bash to integration.bash

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 79adb50b3ce3873c3baf9e6715c1d1c3f181ce43)

12 years agoMerge remote branch 'amitay/tdb-sync'
Ronnie Sahlberg [Wed, 25 Apr 2012 22:09:34 +0000 (08:09 +1000)]
Merge remote branch 'amitay/tdb-sync'

(This used to be ctdb commit 8052ee0a6bda3fa88501d77b2d53315be2b75ec1)

12 years agoMerge remote branch 'amitay/tevent-sync'
Ronnie Sahlberg [Wed, 25 Apr 2012 22:09:23 +0000 (08:09 +1000)]
Merge remote branch 'amitay/tevent-sync'

(This used to be ctdb commit 17ff3f240b0d72c72ed28d70fb9aeb3b20c80670)

12 years agoMerge remote branch 'amitay/talloc-sync'
Ronnie Sahlberg [Wed, 25 Apr 2012 22:09:05 +0000 (08:09 +1000)]
Merge remote branch 'amitay/talloc-sync'

(This used to be ctdb commit fdd5b9ac0a79f6bc7c8a05da2e2f11e002392bcd)

12 years agoMerge remote branch 'martins/master'
Ronnie Sahlberg [Wed, 18 Apr 2012 03:48:43 +0000 (13:48 +1000)]
Merge remote branch 'martins/master'

(This used to be ctdb commit abe7ebe6c531f912efe4ebc1daade4d2af67574c)

12 years agotests: More unit test factoring/rationalisation and bug fixes
Martin Schwenke [Wed, 18 Apr 2012 00:37:45 +0000 (10:37 +1000)]
tests: More unit test factoring/rationalisation and bug fixes

Move some options from eventscripts/run_tests.sh to scripts/run_tests.
Remove the former.

Move some functions from eventscripts/scripts/local.sh to
scripts/unit.sh.

Both of these are modified during move so they are no longer
eventscript-specific.

Tweak */local.sh so that the new functions in unit.sh are used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 7ff485687891732074c9fc9998502ca197663d02)

12 years agotests/eventscripts: Share directories must be absolute in eventscript tests
Martin Schwenke [Wed, 18 Apr 2012 00:35:25 +0000 (10:35 +1000)]
tests/eventscripts: Share directories must be absolute in eventscript tests

This fixes eventscripts/scripts/local.sh:setup_generic() so that
directories listed in $FAKE_SHARES are absolute instead of potentially
relative (and, therefore, ignored by the NFS share check).

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 8544162b7a4efa23c92bc0d2774df95bb7f0f463)

12 years agotests/eventscripts: Tweak an error message in a policy routing test
Martin Schwenke [Tue, 17 Apr 2012 02:57:46 +0000 (12:57 +1000)]
tests/eventscripts: Tweak an error message in a policy routing test

It currently has my home directory pasted into it.  That can't be
right...  ;-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 5d6e71cf6e1e0665ec96e7e4e2cfd31f40ebabae)

12 years agotests - run_tests needs to expand directories like "." and "..".
Martin Schwenke [Mon, 16 Apr 2012 06:27:20 +0000 (16:27 +1000)]
tests - run_tests needs to expand directories like "." and "..".

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit fd08fc6c88cb80190ce87325867de0391cf1af51)

12 years agotests/eventscripts - Restructure according to new convention
Martin Schwenke [Mon, 16 Apr 2012 06:24:12 +0000 (16:24 +1000)]
tests/eventscripts - Restructure according to new convention

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit eb13507713ba6732271b7c3024bfddbda6da5ffc)

12 years agotests - run_tests ignores trailing '/' on directories
Martin Schwenke [Mon, 16 Apr 2012 05:58:44 +0000 (15:58 +1000)]
tests - run_tests ignores trailing '/' on directories

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit dbec696930327ff07b39282e3084eef4ded064c0)

12 years agotests/takeover - Restructure according to new convention
Martin Schwenke [Mon, 16 Apr 2012 05:53:24 +0000 (15:53 +1000)]
tests/takeover - Restructure according to new convention

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit f94897ef9504c144937409688fa7a646e0b0ceae)

12 years agotests/onnode - Restructure according to new convention
Martin Schwenke [Mon, 16 Apr 2012 05:29:44 +0000 (15:29 +1000)]
tests/onnode - Restructure according to new convention

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 4c87888b2a559c0d1f285919a42de450a537a02f)

12 years agotests/tool - Restructure according to new convention
Martin Schwenke [Mon, 16 Apr 2012 04:25:50 +0000 (14:25 +1000)]
tests/tool - Restructure according to new convention

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 89571585d87b391ff79647cd1f0f6ac193079e72)

12 years agotests/tool: New nodestatus test
Amitay Isaacs [Fri, 13 Apr 2012 02:06:53 +0000 (12:06 +1000)]
tests/tool: New nodestatus test

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit ca9e75eaea9c9b02bb44ca338e28fdae0c8d582c)

12 years agotests/tool: Fix the nodestatus test
Amitay Isaacs [Fri, 13 Apr 2012 02:05:59 +0000 (12:05 +1000)]
tests/tool: Fix the nodestatus test

Although not obvious, when asking each node for nodestatus, it will report
each node is the current node.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit a65ba7211ec7f102b32060b173606a61fb5c20a9)

12 years agotests - run_tests includes common.sh, uses die()
Martin Schwenke [Mon, 16 Apr 2012 04:54:51 +0000 (14:54 +1000)]
tests - run_tests includes common.sh, uses die()

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 21df43c74bfcff420fdaf9df5440c25529c543d2)

12 years agotests - run_tests can take a directory as an argument
Martin Schwenke [Mon, 16 Apr 2012 04:52:17 +0000 (14:52 +1000)]
tests - run_tests can take a directory as an argument

This makes it run all tests in the specified directory.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 89719384a74161ffa0c03602ecdd9e758d521d75)

12 years agotests - add -v option to set TEST_VERBOSE=true
Martin Schwenke [Mon, 16 Apr 2012 04:51:22 +0000 (14:51 +1000)]
tests - add -v option to set TEST_VERBOSE=true

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 43badc5418b9f533398cd579607d9f1fc0f8f417)

12 years agotests - move functions only used by scripts/run_tests into that script
Martin Schwenke [Mon, 16 Apr 2012 04:48:49 +0000 (14:48 +1000)]
tests - move functions only used by scripts/run_tests into that script

Along with minor logic tweaks and removal of test_exit().

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 00713eb46cce638339845799bba2da041b3d02fb)

12 years agotests - add scripts/unit.sh
Martin Schwenke [Mon, 16 Apr 2012 04:33:37 +0000 (14:33 +1000)]
tests - add scripts/unit.sh

This will be sourced by all unit tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit afdaa5f032938d56ff315d9553cb285ebc413c4c)

12 years agotests - add scripts/common.sh
Martin Schwenke [Mon, 16 Apr 2012 04:32:55 +0000 (14:32 +1000)]
tests - add scripts/common.sh

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a7ad94fe9f2e773567dbb6500469dd2dd2f2f04b)

12 years agotests - export new variable TEST_SCRIPTS_DIR
Martin Schwenke [Mon, 16 Apr 2012 04:27:22 +0000 (14:27 +1000)]
tests - export new variable TEST_SCRIPTS_DIR

This replaces previous script-local variable ctdb_test_scripts_dir.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 107b465172205cb304549fcffaf36b9416696c15)

12 years agoTests - IP allocation - 2 tests for NODE_FLAGS_NOIPTAKEOVER
Martin Schwenke [Thu, 12 Apr 2012 05:18:17 +0000 (15:18 +1000)]
Tests - IP allocation - 2 tests for NODE_FLAGS_NOIPTAKEOVER

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit fa54a1095a7504863ed30bff8e0828a8be6dde55)

12 years agoTests - IP allocation - add another LCP2 test based on a test failure
Martin Schwenke [Thu, 12 Apr 2012 04:17:46 +0000 (14:17 +1000)]
Tests - IP allocation - add another LCP2 test based on a test failure

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 89e322562f25dcb8d84357a19e71b2272b2f29a8)

12 years agoTests - turn of time logging by default
Martin Schwenke [Thu, 29 Mar 2012 03:54:22 +0000 (14:54 +1100)]
Tests - turn of time logging by default

We haven't seen problems related to time jumps for a long time.  Turn
this off by default.

To switch it back on set $CTDB_TEST_TIME_LOGGING to any non-null
value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 2aa9bbf3a52dde0707eb06acd91e57c8da5c717f)

12 years agolib/tdb: Sync tdb from samba git tree
Amitay Isaacs [Fri, 13 Apr 2012 07:38:14 +0000 (17:38 +1000)]
lib/tdb: Sync tdb from samba git tree

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 0f40ea2386892ae10b30beeded0e00edf4c019c3)

12 years agolib/tdb: Remove the files required to build tdb as a library
Amitay Isaacs [Fri, 13 Apr 2012 07:43:23 +0000 (17:43 +1000)]
lib/tdb: Remove the files required to build tdb as a library

Since tdb library will never be built from ctdb sources, we don't need the build
related files.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit a7aace3d165e6cb7d63950107e584edaee12a357)

12 years agolib/talloc: Sync talloc from samba git tree
Amitay Isaacs [Thu, 12 Apr 2012 03:43:44 +0000 (13:43 +1000)]
lib/talloc: Sync talloc from samba git tree

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 670ebada4bafe79bd535c9bb5cc2d5d49d646af3)