1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

249 Commits

Author SHA1 Message Date
Martin Schwenke
9d03cfde3a Test suite: fix minor typo in complex/32_cifs_tickle.sh
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit cd65d8acb97aa9f83ff0d0585bf09caef2d2f3eb)
2009-08-27 12:35:52 +10:00
Martin Schwenke
1bde47212d Test suite: Fix debug code for unexpectedly unhealthy cluster.
The debug code should run "ctdb status" on a cluster node, not on the
test client.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 448cd8db1305c1e6dfab323f92eac4a576596e4e)
2009-08-27 12:32:16 +10:00
Martin Schwenke
bd98b6c699 Test suite: ctdb_persistent.c needs to use transactions.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 49de8429d2a996dc055370541a12ea36762abe94)
2009-08-14 20:47:38 +10:00
Martin Schwenke
7207e1b837 Merge commit 'origin/master'
(This used to be ctdb commit 0e9c3e0cf76dd33a24241f02709e56bc330f009a)
2009-08-12 08:48:03 +10:00
Michael Adam
6cf67b9bb0 tests: fix the 52_ctdb_fetch.sh test.
The parser for the output of the ctdb_fetch program
did not match the output that ctdb_fetch generates.
It seemed to rather come from the ctdb_bench test...

This patch adapts the parser to correctly interpret
the output of ctdb_fetch.

Michael

(This used to be ctdb commit 836b95f32724cf37e4f643f20653f78842613692)
2009-08-04 09:46:40 +02:00
Martin Schwenke
1cfed53659 Merge commit 'origin/master'
(This used to be ctdb commit abf4540bfb06de56b0a7b5976b5f1b2a24a8743d)
2009-07-31 11:04:37 +10:00
Martin Schwenke
7d1203e4c2 Test suite: Retrieval NFS_TICKLE_SHARED_DIRECTORY more defensively.
In complex/31_nfs_tickle.sh we run sed against a file that might not
exist, causing potential garbage from stderr in the output.  Check
that the file exists before running sed.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f9b71757f034732647228d4b8a8f00528028b6b0)
2009-07-30 14:10:34 +10:00
Martin Schwenke
d7981fdcda Test suite: Better diagnostics for recent change to complex/31_nfs_tickle.sh.
Add a -v so we see the output of the command that tries to get the
value of NFS_TICKLE_SHARED_DIRECTORY.  That way we can tell if a value
was retrived OK or if we're using the default.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c53353c6402f378f29200313d82f1f9262d628b1)
2009-07-30 14:03:44 +10:00
Martin Schwenke
aed71a760d Test suite: complex/31_nfs_tickle.sh should use NFS_TICKLE_SHARED_DIRECTORY.
Rather than hardcoding the location of the shared tickle directory,
attempt to use the value of NFS_TICKLE_SHARED_DIRECTORY from
/etc/sysconfig/nfs on node 0.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 878437a909ea44dfc3635f082e34741ee256e505)
2009-07-30 13:57:40 +10:00
Martin Schwenke
e47328742d Test suite: Ask CTDB about CIFS tickles registered for the actual test node.
This failed when node 0 had no public IPs because we would always run
"ctdb gettickles" on node.  We now ask node 0 for the tickles on the
test node.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 8fcc4610de926f44e18ec85fb57ca5f7d3c28bd6)
2009-07-30 13:45:06 +10:00
Martin Schwenke
3d91b6442e Test suite: Turn off strict host key checking in the SSH failover test.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b7787255391eddef8458f81ff9b75d9116e2afd3)
2009-07-30 13:20:23 +10:00
Ronnie Sahlberg
690f1537f0 Merge commit 'martins/master'
(This used to be ctdb commit 32a69b0efa078b069802470be6488a4efe32961d)
2009-07-30 10:55:56 +10:00
Martin Schwenke
063bd6e278 Test suite: fix test file permissions in complex/44_failover_nfs_oneway.sh.
Something, perhaps root_squash, causing permission denied on the test
file after we copy it over with scp.  This sets the initial
permissions to be friendly and adds -p to the scp command to maintain
those friendly permissions.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 52f21f5a92eb14df7540a2ae9e212d936e646c06)
2009-07-30 10:47:36 +10:00
Martin Schwenke
73ca4b6c8b Test suite: fix the test suite's generic event script.
Add a "stopped" case to log events and stop the event script from
failing with an unknown event.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 7f67f7395e2233f0bba2e9662404aad49e13f645)
2009-07-29 18:10:05 +10:00
Martin Schwenke
48078dd24f Test suite: Fixes for node state parsing plus new stop/continue tests.
The parsing of "ctdb status -Y" output to determine various node
states was implemented very strictly.  Therefore, the parsing broke
due to the addition of the new "stopped" state to the output of "ctdb
status -Y".  This relaxes the parsing so that it should work for
versions prior to the introduction of the "stopped" state, as well as
future versions that add new states to the end of the list of bits in
output of "ctdb status -Y".

Similarly the check for cluster unhealthy (in _cluster_is_healthy())
now just checks for a single 1 in any bit in the "ctdb status -Y"
output, rather than checking for a particular number of 0s.

New tests
tests/simple/{41_ctdb_stop.sh,42_ctdb_continue.sh,43_stop_recmaster_yield.sh}
do rudimentary testing of the stop and continue functions.

Remove tests tests/simple/41_ctdb_ban.sh and
tests/simple/42_ctdb_unban.sh.  They were both unreliable.

tests/simple/21_ctdb_disablemonitor.sh now schedules a restart, since
one will be required.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 67c5bfb5f02c9d45a32d976021ede4fb2174dfe9)
2009-07-29 18:01:07 +10:00
Ronnie Sahlberg
cca0aae1f5 From Michael Adam:
Update the transaction test tool to the new api for transactions

(This used to be ctdb commit 4d9a53f142deba6ab578af2fc35bfa99c29c3a99)
2009-07-29 11:18:02 +10:00
Ronnie Sahlberg
366d413f2b new version 1.0.87
(This used to be ctdb commit d187eb8507f35a650ff3ffc50fa49110eebca0bd)
2009-07-17 13:01:11 +10:00
Martin Schwenke
d846eb78db Test suite: Fix debug code for unexpectedly unhealthy cluster.
The debug code should run "ctdb status" on a cluster node, not on the
test client.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 34e6f8a04b12f8879eb42d417f9741502ccccf0f)
2009-07-16 14:04:06 +10:00
Martin Schwenke
168ec02adf Test suite: new tests and code factoring.
* 2 new tests for NFS failover.

* Factor repeated code from tests into new functions
  select_test_node_and_ips(), gratarp_sniff_start() and
  gratarp_sniff_wait_show().  Use these new functions in existing and
  new tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit de0b58e18fcc0f90075fca74077ab62ae8dab5da)
2009-07-08 13:37:52 +10:00
Martin Schwenke
96b3517356 Test suite: better debug info when the cluster is unexpectedly unhealthy.
cluster_is_healthy() is now run locally in tests and internally causes
_cluster_is_healthy() to be run on node 0.  When it detects that the
cluster is unhealthy and $ctdb_test_restart_scheduled is not true,
debug information is printed.  This replaces the previous use of
$CTDB_TEST_CLEANING_UP.

To avoid spurious debug on expected restarts, added scheduled
restarts to several tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ee7caae3a55a64fb50cd28fa2fd4663c5dd83b4f)
2009-07-06 17:52:11 +10:00
Martin Schwenke
d90d54ea3e Make ctdbd restarts in tests more reliable.
This works around potential race conditions in the init script where
the restart operation is not necessarily reliable.  It just wraps the
actual restart in a loop and tries for a successful restart up to 5
times.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 1cac8a0ad429f29d1508158c7f7c42a2f1a22945)
2009-07-06 16:40:31 +10:00
Martin Schwenke
35f998346e When testing make the time taken for some operations more obvious.
If wait_until() does not timeout, print the time taken for the command
to succeed.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit bdb856ee22816ae1f6b8d15856555f488054f489)
2009-07-06 16:39:08 +10:00
Martin Schwenke
5d67aa2332 New tests for different aspects of failover.
3 separate tests:

* Check that gratuitous ARPs are received and take effect.

* Check that ping still works after failover.

* Check, via SSH, that the hostname changes after failover.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 92011cc05bbdb517ec6a4573f5cb9f6f21c3059e)
2009-07-03 20:55:02 +10:00
Martin Schwenke
613341d150 Updates to TCP tickle tests and supporting functions.
* Removed a race from tpcdump_start().  It seems impossible to tell
  when tcpdump is actually ready to capture packets.  So this function
  now generates some dummy ping packets and waits until it sees them
  in the output file.

* tcpdump_start() sets $tcpdump_filter.  This is the default filter
  for tcpdump_wait() and tcpdump_show(), but other filters may be
  passed to those functions.

* New functions tcptickle_sniff_start() and
  tcptickle_sniff_wait_show() handle capturing TCP tickle packets.
  These are used by complex/31_nfs_tickle.sh and
  complex/32_cifs_tickle.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 8e2a89935a969340bfead8ed040d74703947cb81)
2009-07-03 20:44:55 +10:00
Martin Schwenke
7b3abce684 Add an extra ctdb recovery to test function restart_ctdb().
There are still very rare cases where IPs haven't been reallocated
before the beginning of the next test, so this adds a sleep and an
extra call to "ctdb recover" to restart_ctdb().

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c2bdb77d91761c003e2f0e6918a27c54150f6030)
2009-07-03 18:01:29 +10:00
Martin Schwenke
dba6c1ca77 Fix the run_tests script so that the number of columns is never 0.
Sometimes "stty size" reports 0, for example when running in a shell
under Emacs.  In this case, we just change it to 80.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e309cb3f95efcf6cff7d7c19713d7b161a138383)
2009-07-03 17:58:38 +10:00
Martin Schwenke
0d425a07d4 Separate test cleanup code in output and clean up ctdb restart code.
* ctdb_restart_when_done() now schedules a restart by setting an
  explicit variable that is respected in ctdb_test_exit(), rather than
  adding a restart to $ctdb_test_exit_hook.  This means that restarts
  are all done in one place.

* ctdb_test_exit() turns off "set -e" to make sure that all cleanup
  happens.

* ctdb_test_exit() now prints a clear message indicating where the
  test ends and the cleanup begins.  This message also includes the
  return code of the test.

* Add debug in cluster_is_healthy to try to capture information about
  unexpected unhealthiness when a test starts.

* Simplify simple/07_ctdb_process_exists.sh so that the exit code is
  generated more obviously.

* Remove redundant calls to ctdb_test_exit at the end of tests, since
  they're done automatically via a trap.  Also remove any preceding
  warnings of restarts or final hints about test success/failure.

* Allow multi-digit debug levels in simple/12_ctdb_getdebug.sh and
  simple/13_ctdb_setdebug.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b6fa044a1364cbb3008085041453ee4885f7ced1)
2009-07-03 17:40:16 +10:00
Martin Schwenke
62871fbcd5 Clean up handling the of CTDB restarts in testcases.
Glitches during restarts of the CTDB cluster have been causing some
tests to fail.  This is because restarts are initiated in the body of
many tests.  This adds a simple function ctdb_restart_when_done, which
schedules a restart using an existing hook in the test exit code.
This function is now used in tests that need to restart CTDB.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d440e83bb4f0c19c085915d0f0e87cc0dabbc569)
2009-06-19 11:40:09 +10:00
Martin Schwenke
ffff61c13b New tests for NFS and CIFS tickles.
New tests/complex/ subdirectory contains 2 new tests to ensure that
NFS and CIFS connections are tracked by CTDB and that tickle resets
are sent when a node is disabled.

Changes to ctdb_test_functions.bash to support these tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 31cc46eb157ca1301312f14879e4fb4da7d81088)
2009-06-16 12:47:59 +10:00
Martin Schwenke
ad3c89095e Make 51_ctdb_bench.sh more tolerant.
Limit the allowable difference in message counts in either direction
around the ring to 5% (up from 2%).  There is something environmental
making this blow out to 3% very occasionally when there's no obvious
problem with ctdb.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d6e6909ac629212b3028e13b958e1a17c64bee8c)
2009-06-10 16:15:09 +10:00
Sumit Bose
887046352d fix re pattern to accept the new recovery lock times in the statistics output
(This used to be ctdb commit ba44aae7307b4fa56f7b2da2cd9d4a7ccd0a135e)
2009-05-25 11:15:00 +10:00
Ronnie Sahlberg
26e1486db7 Whitespace changes and using the CTDB_NO_MEMORY() macro changes to
the previous patch.

(This used to be ctdb commit d623ea7c04daa6349b42d50862843c9f86115488)
2009-05-21 11:49:16 +10:00
Sumit Bose
2fcedf6dac add missing checks on so far ignored return values
Most of these were found during a review by Jim Meyering <meyering@redhat.com>

(This used to be ctdb commit 3aee5ee1deb4a19be3bd3a4ce3abbe09de763344)
2009-05-21 11:22:21 +10:00
Martin Schwenke
2a09b4bad3 In 51_ctdb_bench.sh now allows a 2% difference between positive and
negative.  ctdb_bench.c checks to ensure the timer has advanced from 0
before dividing.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 723413f246399b25166462d2018237920515655f)
2009-05-12 14:45:46 +10:00
Martin Schwenke
d59cd199e4 Avoid floating point divide by 0 in ctdb_fetch.c's bench_fetch().
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3c67e164eb92591f8763883430490805c1dfa9ed)
2009-05-12 14:45:14 +10:00
Martin Schwenke
7c7c5b3489 Bug fixes for tests: simple/12_ctdb_getdebug.sh and scripts/test_wrap.
simple/12_ctdb_getdebug.sh now recognises output with multi-digit node
numbers.

Sharing the ctdb directory via NFS and testing on a real cluster by
setting CTDB_TEST_REAL_CLUSTER didn't work by default.  The fix is to
hack scripts/test_wrap so that it tries to find a valid bin directory
next to the directory containing it is in.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ea2ca769e1d1068fbbad843750b19acfd87360e0)
2009-05-12 14:44:30 +10:00
Martin Schwenke
9666d7bf0a Use ctdb_fetch_lock rather than ctdb_call.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5f3d2e29a446972ac244e20a08e48f4c2f4ffef4)
2009-05-12 08:55:36 +10:00
Andrew Tridgell
a0c86e4013 Merge commit 'ronnie/master'
(This used to be ctdb commit 1a110993af1706e0c5df500fa7d14e16c0668372)
2009-02-09 10:53:47 +11:00
Michael Adam
b183acf467 add a simple test script to test ctdb_check_tcp_ports
Michael

(This used to be ctdb commit 2634f1bd216ce18f061a282a53314cb1650dbd05)
2009-01-30 22:49:17 +01:00
Martin Schwenke
1b61a149f4 Make message in 62_ctdb_persistent_unsafe.sh more informative.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4777b74b1e2eebe54cf27f3303f60e49023e7f6a)
2009-01-16 15:50:33 +11:00
Martin Schwenke
fc1f71ce0f 23_ctdb_moveip.sh sanity checks the list of IPs/nodes instead of
looping forever on older versions of CTDB.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 03dfcf9f284c9926479a8dd4e5acf1f5d2b964aa)
2009-01-16 15:12:40 +11:00
Martin Schwenke
7c6153e6aa Remove the sorts from 06_ctdb_getpid.sh - the PIDs should be listed in
node order.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4b97bdba3bc4df20efb1aae7d89a1e3430d35ca3)
2009-01-13 17:02:59 +11:00
Martin Schwenke
5038a0d08a Use $CTDB_TEST_WRAPPER in other tests that need it.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 2912c1ade5db1e20bfa3a8017a702cc8a7da36f1)
2009-01-13 14:55:31 +11:00
Martin Schwenke
cb09075891 Use $CTDB_TEST_WRAPPER in 51_ctdb_bench.sh.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 44ec4c57bf9928ef5d5cc117a6c2d92495dac489)
2009-01-13 14:51:40 +11:00
Martin Schwenke
38593aa3e1 For now, make tests/run_tests.sh runs the new test suite. Add
tests/TODO.  Remove tests/start_daemons.sh - no longer used.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5cdbef46b74e6a5ba2383ef025e69fe605fa4f6e)
2009-01-12 15:47:12 +11:00
Martin Schwenke
2e87ed4e9d Test binaries now go in tests/bin and ctdb_test_env now adds this
directory to $PATH if local daemons are being used.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a497010f67d6a8e68f4d6d7e516b88d2261b1062)
2009-01-09 18:15:06 +11:00
Martin Schwenke
91972a6bfc Add tests/README. ctdb_test_env and, therefore, run_tests can now be
run from the tests subdirectory... and most other sensible places.
Rename $CTDB_TEST_REMOTE_SCRIPTS_DIR to $CTDB_TEST_REMOTE_DIR since it
is now intented that this directory can contain test binaries too.
daemons_start() now passes a full path to the events.d directory when
starting ctdbd.  Also fixed the path to ctdbd.  41_ctdb_ban.sh and
42_ctdb_unban.sh fail immediately if they fail to select a test node.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3ecce31d3a3f72b9fa851ac99291865c119e551e)
2009-01-09 17:52:38 +11:00
Martin Schwenke
a70327ce1a Delete some unstructured tests ({fetch,peristent,transaction}.sh) and
replace them with new simple tests (52_ctdb_fetch.sh,
53_ctdb_transaction.sh, 61_ctdb_persistent_safe.sh,
62_ctdb_persistent_unsafe.sh).  Remove "_simple" from some test
filenames in the simple subdirectory - that's redundant.  Always run
ctdb as $CTDB to allow $VALGRIND magic to be used.  Use pgrep/pkill to
detect/kill local daemons so those running under valgrind can be found
too - to support this, always run local daemons with the full path to
the executable.  run_tests now supports -s option to print sumamry
when done - with more and more tests, it is getting hard to follow
progress.  Sort the output of commands in 06_ctdb_getpid.sh to make
sure they compare nicely and also allow the processes' executables to
be called "memcheck" to catch those running under valgrind.  Remove
redundant calls to onnode in commands run from calls
try_command_on_node in some tests.  41_ctdb_ban.sh and
42_ctdb_unban.sh avoid banning the recmaster, since this causes the
recmaster to be reassigned and all nodes to be unbanned.  Minor
cleanups.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 33cdf3e4bcfadf8e20822ca352babf7acca16821)
2009-01-08 17:12:03 +11:00
Martin Schwenke
6ad847b9ac Remove old ctdbd.sh test script. Remove unneeded nodes.txt and
public_addresses files - these are now created in tests/var as needed.
09_ctdb_ping.sh now recognises new "node disconnected" message.
Replace custom recovery detection code (which could not have been
working) with a call to "ctdb recover" in 32_ctdb_enable_simple.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 486ed3b5b483f1c12c2d978ec6564bd33a2c6aee)
2008-12-18 14:25:07 +11:00
Martin Schwenke
c572c11d3a Remove bench.sh test and replace with new test 51_ctdb_bench.sh.
Function try_command_on_node node passes any options other than -v to
onnode.  Minor update to 14_ctdb_statistics.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e627f8e5fe8e2e3ea423b7dbd12d74597fb4983b)
2008-12-18 11:28:43 +11:00