1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

699 Commits

Author SHA1 Message Date
Amitay Isaacs
a00e50e503 ctdbd: Replace lockwait with locking API and remove ctdb_lockwait.c
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 2126795153dacb255e441abcb36ee05107b6282a)
2012-10-20 02:48:44 +11:00
Amitay Isaacs
cbf16856f8 ctdbd_test: Include ctdb_lock.c code for test stubs
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit caff197edf6f928494028ac6c993901954aaa36f)
2012-10-20 02:48:44 +11:00
Amitay Isaacs
6182d9eaa1 tests: Fix statistics test for new output lines from locking API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1ee55c511b99e9f8a6fa4e34207267e953f09bae)
2012-10-20 02:48:44 +11:00
Martin Schwenke
66d0aba85b Revert "Eventscripts - add facility to 10.interface to delete unmanaged IPs"
This reverts commit 88f88d86b0d08240f749fb721b8c401c2eeb1099.

This is dangerous and, on reflection, I can't see it being useful.
There are often permanent IPs on interfaces that CTDB shares with its
public IPs.

(This used to be ctdb commit 16aba4eb620844626a1c71c58b51658caf44dea6)
2012-10-18 20:05:42 +11:00
Martin Schwenke
8e7facc5d3 tests/eventscripts: add unit tests for policy routing reconfigure
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit bd4ff176387372b1c233373c0bc8ced523fc9670)
2012-10-11 12:10:45 +11:00
Martin Schwenke
cfef702363 tests/eventscripts: add extra infrastructure for policy routing tests
Less copying and pasting is a good thing...

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

(This used to be ctdb commit 7d4b8cce96f33fff647a0c9d259c121dfc8403e9)
2012-10-11 12:10:45 +11:00
Martin Schwenke
2d719e5c84 eventscripts: Auto-start/stop services in background
If $CTDB_SERVICE_AUTOSTARTSTOP="yes" then service start/stop is done
in the background with logging.

Fix some unit tests for samba and winbind.

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

(This used to be ctdb commit 3a3dae4cb5ec8b4b8381a4013adda25b87641f3a)
2012-10-03 08:48:23 +10:00
Martin Schwenke
f3ae31e741 Eventscripts: split 50.samba into 49.winbind and 50.samba
winbind and samba can be separately managed.  This makes the service
starting and stopping code way too complicated, and even adds a small
amount of complexity to the monitoring code.  The sensible option is
to split this eventscript in two.

There are two potentially backward incompatible changes here:

* Functionality has been removed that allowed 50.samba to manage
  winbind when CTDB_MANAGES_WINBIND was unset but the smb.conf
  "security" parameter was set to "ADS" or "DOMAIN".

  Maintaining this functionality would have required moving the
  testparm-related code to the functions file, deciding where the
  cache file should go, and then calling it from both 49.winbind and
  50.samba.  This feature wasn't of great value and asking
  administrators to set an extra variable in exchange for code
  simplicity seems like a reasonable deal.

* External code will need to be changed if it calls 50.samba directly
  with winbind-related expectations.  This is fairly obvious!

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

(This used to be ctdb commit 34535ae64420926b9a3bf7d453fed4e6f4c90115)
2012-10-03 08:46:32 +10:00
Martin Schwenke
28345d83c0 tests/tool: New tests for natgwlist, getcapabilities, lvs, lvsmaster
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6bd4feff7039138d435428eeded51975c44e567c)
2012-09-28 17:05:34 +10:00
Martin Schwenke
3ccaba7842 tests/tool: New function setup_natgw() to setup $CTDB_NATGW_NODES
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 0f0aef21a1bb2d88a8c184ef70c718e0c91acdc3)
2012-09-28 17:05:34 +10:00
Martin Schwenke
29d3af2ed5 tests: libctdb stubs initial ctdb_getcapabilities() implementation
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 81af67c6959fdbe0566e3f1a00e2be58dd268dc6)
2012-09-28 17:05:34 +10:00
Martin Schwenke
7660072544 tests: libctdb stubs must copy pointers rather than just returning them
Some code (e.g. NAT gateway code) modifies the returned result so was
modifying the original.

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

(This used to be ctdb commit a3f15d2828325bbfba5bc5c0a30429e2ce572a44)
2012-09-28 17:05:34 +10:00
Martin Schwenke
7d971f4fe7 tests/eventscripts: New policy routing test with invalid table ID
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 93c97c3ba3ff714dfa0d056a91ff45010a6e2d66)
2012-09-11 12:52:22 +10:00
Martin Schwenke
3d6865150b tests/eventscripts: Modify ip stub to simulate invalid table ID
This involves refactoring ip_route_check_table() into a new function
ip_check_table() which tables the operation type (i.e. rule/route) as
an argument.

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

(This used to be ctdb commit acdaa04079a9827885f32a7bc078d3365c89b474)
2012-09-11 12:52:22 +10:00
Martin Schwenke
f6f711ee4d tests/eventscript: unit test for 13.per_ip_routing bogus route removal
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6d41208074f0e9b56c585bca7eb39aaed653c4ca)
2012-09-11 12:52:22 +10:00
Martin Schwenke
aed0f9d1b9 tests/eventscripts: Add a policy routing unit test for "ip rule del" failure
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 0ce5b079f327aba55b62800ccb22d79976fac665)
2012-09-11 12:52:22 +10:00
Martin Schwenke
184db1b6be tests/eventscripts: Extra cases for policy routing missing config test
Test the startup and monitor events too.

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

(This used to be ctdb commit c29a943f9bbcfecb861e71d007c7698a53dc8773)
2012-07-30 15:57:56 +10:00
Martin Schwenke
a90f6d7cd1 tests/tool: Run ctdb_tool_* under $VALGRIND
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6616a5712b5d4db2b9ba6a88cec79378696c2184)
2012-07-26 22:03:00 +10:00
Martin Schwenke
d26c21df4a tests/eventscripts: Rewrite the testparm stub
It currently needs the real testparm command installed even though it
only uses limited features.  It is easy enough to fake up the
functionality that 50.samba uses.

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

(This used to be ctdb commit 7ef9916bd95ff2472359a412eac5489f1aad2dce)
2012-07-26 22:03:00 +10:00
Martin Schwenke
cb8517ed4c tests/complex: Fix broken ctdb_test_check_real_cluster()
It doesn't set $h at all...

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

(This used to be ctdb commit 3f268805c14c51f23024267916eae161bada8a0e)
2012-07-26 22:03:00 +10:00
Martin Schwenke
e2a604f93c tests/simple: ctdb stop/continue tests weren't actually checking IPs
The correct variable is $test_node_ips, not $ips.

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

(This used to be ctdb commit 8d17dacee415dd0b4268805a366a86f83e33f27c)
2012-07-26 22:03:00 +10:00
Martin Schwenke
523be079ea tests: select_test_node_and_ips() should try to avoid failing
Sometimes "ctdb sync" doesn't do its job, so we end up with unassigned
IPs.

If $test_node isn't set then this is bad.  However, try a few times to
ensure it is set.

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

(This used to be ctdb commit 2fd0157382b42aa5c5212b8e743c6f589edc6662)
2012-07-26 22:03:00 +10:00
Martin Schwenke
959e37da7b tests: simple tests against local daemons should check $TEST_LOCAL_DEAMONS
Note the old $CTDB_TEST_REAL_CLUSTER - it doesn't exist anymore...

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

(This used to be ctdb commit 47180dc75d15f3d61470705603565b718491c9f8)
2012-07-26 22:03:00 +10:00
Martin Schwenke
053174c07b tests: run_tests should exit with $status with -e option
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 619af3e857c2ced3840abfd86135cc954796da97)
2012-07-26 22:03:00 +10:00
Martin Schwenke
867381486d tests/simple: ctdb reloadips test should use $test_ip
There's no point recalculating this value.

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

(This used to be ctdb commit 6e7bd9685406ae024d413a5d9d8c6e0d89b15567)
2012-07-26 22:03:00 +10:00
Martin Schwenke
c075c2e5c9 tests: select_test_node_and_ips() should never select non-node -1
Instead of selecting the 1st pnn found, select the 1st one that isn't -1.

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

(This used to be ctdb commit f02e501342112aab67aee95f253e29a670b29273)
2012-07-26 22:03:00 +10:00
Michael Adam
27ce9dc366 run_tests: improve spacing
(This used to be ctdb commit a0a0f5588445aeabe07b0e4d65087db454dc09da)
2012-07-03 14:30:25 +02:00
Michael Adam
334557680c run_tests.sh: fix a comment
(This used to be ctdb commit 0e515115b3c21cb179fd7a6356164ac1b5d423e0)
2012-07-03 14:30:24 +02:00
Amitay Isaacs
9881ec8e64 tests: Increment RSN always in ctdb_update_record_persistent test
If the record does not exist in persistent DB, RSN for that record is
considered 0. To write a record, RSN for that record should be set to 1,
otherwise the RSN check would fail.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ac89da4eea98fa686408c5671a6c44c0fd1d7a58)
2012-05-28 11:22:28 +10:00
Amitay Isaacs
0cb1cc631d tests: Fix ctdb_fetch test (parse extra lines of output)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 0be452958db95c8253c362a1c08a1966e53a1f99)
2012-05-28 11:22:28 +10:00
Amitay Isaacs
88529e8a89 tests: Fix flakey behavior of ctdb_fetch test
There were two issues with this test:

1. Since the messages are sent from one node to the next, if a node
   does not register for messages before CTDB on that nodes receives
   the message, it will never be seen by ctdb_fetch and it would
   block on receive and would not send any messages to next node.
   The crude solution is to sleep just before the messages are sent,
   so that ctdb_fetch on all nodes have registered for the messages.

2. If ctdb_fetch stops sending messages after timelimit expiry, the
   next node will keep waiting to receive messages in event_loop_once().
   The default timeout is 30 seconds for event_loop_once(). Adding a
   timed event will always set the timeout value to the time remaining
   for the timed event to expire.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit bc55e09fdac9f743d6428bfe0be77840ad0fd1ba)
2012-05-28 11:22:27 +10:00
Martin Schwenke
0e1f20fe03 tests/eventscripts: Tweak expected output for lockd:b restart
Commit 13acd58c41fba1a33894fbd654fed69ea0eac322 mades this test fail,
since lockd:b and lockd:bs were incorrectly producing the same output.

(This used to be ctdb commit fd3b73d7e634f16cbb99d7d5a548e12f00d1aadb)
2012-05-25 15:26:26 +10:00
Martin Schwenke
2d953e6957 tests: Complex tests must not be run from a cluster node
Tickle tests fail if run from a node involved in the test.

The condition is actually weaker than this: the test can't be run from
a CTDB node that is hosting public addresses that may be used by the
test.

Rework ctdb_test_check_real_cluster() to support checking this.

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

(This used to be ctdb commit 14012781c3751a514055df29ea70adfb12ecb2d9)
2012-05-25 15:26:18 +10:00
Martin Schwenke
e2831efd0c tests: test_wrap needs to set TEST_BIN_DIR when installed
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c5e3e4bccbde349739b90d8761e1aa19637887a8)
2012-05-25 15:25:44 +10:00
Amitay Isaacs
cfe030e297 tests: Use per node log files when running tests with local daemons
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 61df417821762d87ed01a7b5e64c35079940344d)
2012-05-25 15:25:15 +10:00
Martin Schwenke
aa50bc580c 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)
2012-05-14 15:13:41 +10:00
Martin Schwenke
4563865fb6 tests: Fix a typo in daemons_setup()
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 863ad337fa3c4effe1fd370d3ba414027c600bd6)
2012-05-14 15:13:41 +10:00
Martin Schwenke
8880484658 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)
2012-05-14 15:13:41 +10:00
Martin Schwenke
e3d357b9c3 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)
2012-05-14 15:02:19 +10:00
Martin Schwenke
594601bdad 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)
2012-05-14 15:02:19 +10:00
Martin Schwenke
b8e9a3e54d tests: Add a test for "ctdb reloadips"
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d2514051761ba23deee0e118c25afab2ab8d854e)
2012-05-11 12:13:24 +10:00
Martin Schwenke
f510ae64cb 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)
2012-05-11 10:33:27 +10:00
Martin Schwenke
99ed2d11e1 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)
2012-05-11 10:33:27 +10:00
Martin Schwenke
af2ab74beb 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)
2012-05-11 10:33:27 +10:00
Martin Schwenke
b713c11621 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)
2012-05-11 10:33:27 +10:00
Martin Schwenke
4cf10db7d4 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)
2012-05-11 10:33:27 +10:00
Ronnie Sahlberg
a57eba2bb4 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)
2012-05-03 14:03:26 +10:00
Amitay Isaacs
ec72e30b8f tests/simple: Fix typo in the test message
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c642b452e7b0272e32c02509ac579b790d9a03e7)
2012-05-01 12:09:38 +10:00
Martin Schwenke
c30356c140 tests: Update README
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e9fad1ff82e6fb9e6bf615986c41c746fd415058)
2012-04-27 17:19:45 +10:00
Martin Schwenke
a4f4df233f 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)
2012-04-27 15:42:43 +10:00