summaryrefslogtreecommitdiffstats
path: root/ctdb/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* tests/simple: Minimise the chance of a monitor event being cancelledMartin Schwenke2013-08-221-0/+4
| | | | | | | | | | | | | | A monitor event following a "ctdb delip" might reconfigure services. If the monitor event is cancelled then a service might be stopped but not yet restarted and this could result in the subsequent monitor events failing. This obviously needs to be fixed in CTDB itself. This will happen by making "ctdb reloadips" the supported way of reconfiguring IPs. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 618ea3660e36e7bd92b686e1ca8728cf63c3c068)
* eventscripts: Become unhealthy faster on nfsd failureMartin Schwenke2013-08-143-12/+3
| | | | | | | | | | | | | | | | | Anecdotal evidence suggests that most nfsd RPC check failures are due to cluster filesystem or storage problem. Apparently these are rarely helped by attempting to restart the NFS service because the restart tends to hang. Fail after 2 nfsd RPC check failures, instead of waiting for 6 failures. Restart on every 10th failure to try to bring the node back to good health. Update unit tests to match. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e9ef93f7b6dad59eabaa32124df81f3e74c651ef)
* eventscripts: Print a message when waiting for TCP connections to be killedMartin Schwenke2013-08-141-0/+3
| | | | | | | | This makes the gaps in the logs more obvious. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 11fbf4789d783dd0bac22754b374dd9ea4b03bad)
* eventscripts: Add modulo (%) operator to ctdb_check_counter()Martin Schwenke2013-08-141-1/+11
| | | | | | | | Also add it to the corresponding eventscript unit test infrastructure. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f4ef83a256f59eeb00b9a5bc10c28347e1ad1031)
* eventscripts: Separate out RPC service restart codeMartin Schwenke2013-08-142-10/+4
| | | | | | | | | | | | | | | | | | While doing this: * Explicitly assign RPC program and version information in _nfs_check_rpc_common(). This is more lines of code but is easier to read. * Don't print the options when starting a service. Trying to print it makes the code messy for little benefit. Update the eventscript unit testing code and a Ganesha test to reflect this. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e8b531405665885196c95fe1608db33a255bf761)
* tests/eventscripts: Override background_with_logging(), just prepend "&"Martin Schwenke2013-08-146-31/+34
| | | | | | | | | | | | That is, output that goes through background_with_logging() just gets "&" prepended to each line. This is cleaner than having the tests grovel through logs. Update some 49.winbind/50.samba tests to deal with this. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3ba933d806106d12bc48b83b22d0f314d9d1e5e5)
* eventscripts: Remove support for RPC service 'q' and 's' restart flagsMartin Schwenke2013-08-141-6/+2
| | | | | | | | They're hard to maintain and provide very little benefit. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 1a1be43f8466d46913dcdfe6dcedb94316cd28ad)
* tests/simple: Unreachable node test should wait for recovery to completeMartin Schwenke2013-08-141-0/+2
| | | | | | | | | This should minimise the chances of a control timing out. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 63be516673c5d9c0d543617bf1bb8bca919956a8)
* tests/simple: Fix the missing IP testMartin Schwenke2013-08-141-6/+8
| | | | | | | | | | | | | | | Update the missing IP test to wait until restarts are complete. Otherwise a service restart can collide with the following monitor event and cause chaos. Also, do not disable 10.interface until it matters. Disabling it too early can cause even more chaos if something goes wrong with the monitor step. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 4e3bd06916bd3adac213fb18c7c2a24854b02d45)
* tests: Add a test program to hold a lock on a databaseAmitay Isaacs2013-08-011-0/+42
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit f6b066a23610fb0092298861c21a9b354b91e2f1)
* eventscripts: kill_tcp_connections() should send connections to stdinMartin Schwenke2013-07-295-0/+84
| | | | | | | | | | | | | | | This avoids issuing multiple "ctdb killtcp" commands to terminate tcp connections, one per connection. This will considerably reduce the time when there is a large number of tcp connections. This also makes it possible to avoid calling "ctdb killtcp" when there are no connections. Add a couple of unit tests for killtcp and update eventscript unit test infrastructure to support. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a20d94717d2e4ab866d8a002cdf39c0669b74c6a)
* tests: Always tally the number of passed/failed testsMartin Schwenke2013-07-291-2/+5
| | | | | | | | Regardless of whether a summary is being printed! Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a69e03a5e4671e998d45b4fef8611a421bbdb3e1)
* tests/complex: Fix NFS tests to work with root_squashMartin Schwenke2013-07-234-49/+50
| | | | | | | | | Refactor the NFS test setup/cleanup code into new common functions. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 29e98017221326bdc9b1c4f7c05b3b495c1de29b)
* tests: Fix exit status of run_tests when a single test is run with -HMartin Schwenke2013-07-221-6/+6
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9d6e1c147bd036d832b98c155f405ee2a5d6f57f)
* tests/simple: Add -p in onnode test to help show groups of connectionsMartin Schwenke2013-07-221-1/+1
| | | | | | | | | | | Change the command from "true" to "hostname" since the former won't produce any output when used in combination with "onnode -p". This could just be changed to "echo" but the hostname might actually be useful. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ae3c03d80264e997b7da9f3279d7810e18b8a1df)
* tests/eventscripts: Add tests for monitoring of missing interfacesMartin Schwenke2013-07-194-54/+108
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 53e4eca74429f76adc81d98e3d11d1bd61194d71)
* Fixes for various issues found by CoveritySumit Bose2013-07-111-0/+5
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 05bfdbbd0d4abdfbcf28e3930086723508b35952)
* Tests: Correct the arguments to memsetAmitay Isaacs2013-07-111-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 9ffcd6a91287d86bae7b0c73aa129c81126e08e7)
* tests/eventscripts: Add some rudimentary tests for 60.ganeshaMartin Schwenke2013-07-054-0/+81
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e1cf1f728236d808bb41265e74bc65f54bf1c133)
* tests: If connection to ctdb daemon fails, exitAmitay Isaacs2013-07-046-0/+18
| | | | | | | | | This fixes the segmentation error if any of the test code fails to connect to CTDB daemon. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d48eecd748830598f4f080952f2bf05d6f92738c)
* tests: Integration tests use "ctdb nodestatus" for healthy cluster checkMartin Schwenke2013-06-221-15/+2
| | | | | | | | Also check that we're not in recovery mode. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b7aaa28b3a6a2de923417f3d143f8d516447711e)
* tests: Integration test infrastructure should do only a single recoveryMartin Schwenke2013-06-221-4/+0
| | | | | | | | No need for 2 recoveries after a restart. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b953524185632d7f96a76d8f3bbed7ac1d143d40)
* tests/eventscripts: New tests for 00.ctdb "init" eventMartin Schwenke2013-06-2016-6/+258
| | | | | | | | | | | | | | | These test dropping of IPs and TDB checking. New stubs for date, tdbdump, tdbtool. Enhance ip stub to handle "ip addr show to ..." Tweak some infrastructure. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit aabf0bf41cb8ec344f06b69492fb6c2a27f9e900)
* tests/eventscripts: setup_ctdb() should always set $CTDB_PUBLIC_ADDRESSESMartin Schwenke2013-06-201-1/+2
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit c3e7a6e10d486ba0dbafdf110db540675b2317bc)
* build: Fix tdb.h path to enable building with system TDB libraryMathieu Parent2013-06-141-1/+1
| | | | (This used to be ctdb commit f8bf99de3a5f56be67aaa67ed836458b1cf73e86)
* tests/eventscripts: Unit tests for $CTDB_NFS_DUMP_STUCK_THREADSMartin Schwenke2013-06-145-1/+63
| | | | | | | | Includes minor test infrastructure updates. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit cd4358b01c6c3d413b431f5760029d2b163b9c03)
* tests/eventscripts: Fix -X tracing in iterate_test()Martin Schwenke2013-06-141-6/+5
| | | | | | | | ... and delete a bogus comment. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0e2b5a8f89440a53f996482ac0c98b31a4f2cad3)
* tests/eventscripts: Add unit tests for $CTDB_MONITOR_NFS_THREAD_COUNTMartin Schwenke2013-06-145-0/+53
| | | | | | | | Includes minor test infrastructure updates. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ce2ef2be8aa22c0baf868daac8d4cf27246baa14)
* tests: Do not use err() to support AIXAmitay Isaacs2013-05-291-4/+6
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 1734562a7b3512853b9e0232880c42d50c1c2e4c)
* tests: Include system/time.h to support building on AIXAmitay Isaacs2013-05-293-7/+2
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 0320bb4f8ca8171812ec7f41556aed847c74bfb4)
* tests/integration: Improve debug output for unhealthy cluster after restartMartin Schwenke2013-05-281-4/+7
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 25a6fd784cde96f3d20a79f70b5589b5c4aca675)
* tests/scripts: Delete unused $rows and $ww variables from run_testsMartin Schwenke2013-05-281-3/+0
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 80b3cf2c652c6098390cdd0dbb3edc648f7df487)
* scripts: Provide mktemp function for platforms without mktemp commandMartin Schwenke2013-05-271-0/+21
| | | | | | | | | | | This is needed for AIX and possibly others. Also provide a cheaper mktemp function is needed in the run_tests script. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b2b572e9049c7138bd223226475bef8fe3e01f10)
* tests: Fix integration tests to use real private IPsMartin Schwenke2013-05-271-2/+2
| | | | | | | | 192.0.2.x was a typo. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c9e36f596c63c9af7f80d7cb8d7a5c6dcca4860a)
* tests/takeover: New test with 900 IPsMartin Schwenke2013-05-241-0/+1813
| | | | (This used to be ctdb commit 75a620c516e384f042b5d675183b3a1b48fd6115)
* tests/takeover: Takeover tests can use up to 1024 and checks limitsMartin Schwenke2013-05-241-1/+13
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit cfd1371d3a1f78a0ed86485d83bd4d311727c3d4)
* tests/takeover: LCP2 tests for weird, unbalanced corner-casesMartin Schwenke2013-05-243-0/+201
| | | | | | | | 2 tests to show a bad result and a 3rd test for the fix. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ef35c8889d90220929e48e66eb62da9ea2025ede)
* tests/takeover: Allow takeover runs with differing IP allocations per nodeMartin Schwenke2013-05-242-12/+48
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 954ae6f84cb06a8dcbc12456d4752280072be5bf)
* tests/takeover: New tests to check runstate handlingMartin Schwenke2013-05-243-0/+108
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c57430998a3bdedc8a904eb3a9cdfde1421aff50)
* recoverd: Nodes can only takeover IPs if they are in runstate RUNNINGMartin Schwenke2013-05-241-1/+29
| | | | | | | | | | | | | Currently the order of the first IP allocation, including the first "ipreallocated" event, and the "startup" event is undefined. Both of these events can (re)start services. This stops IPs being hosted before the "startup" event has completed. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit f15dd562fd8c08cafd957ce9509102db7eb49668)
* tests: Fix output of run_tests usageAmitay Isaacs2013-05-241-2/+2
| | | | (This used to be ctdb commit 29911fa44a480c17c701528ef46919b2a962a366)
* locking: Use separate locking helper binary for lockingAmitay Isaacs2013-05-241-0/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 7cde53a6cbe74b1e46f7e1bca298df82c08de866)
* recoverd: takeover_run_core() should not use modified node flagsMartin Schwenke2013-05-231-21/+24
| | | | | | | | | | | | | | | | Modifying the node flags with IP-allocation-only flags is not necessary. It causes breakage if the flags are not cleared after use. ctdb_takeover_run() no longer needs the general node flags - it only needs the IP flags. Instead of modifying the node flags in nodemap, construct a custom IP flags list and have takeover_run_core() use that instead of node flags. As well as being safer, this makes the IP allocation code more self contained and a little bit clearer. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 14bd0b6961ef1294e9cba74ce875386b7dfbf446)
* recoverd: Remove unused mask argument and initial mask calculationMartin Schwenke2013-05-071-9/+3
| | | | | | | | This has been replaced by set_ipflags() and associated functionality. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d0a3822573db296e73cc897835f783c8abc084b3)
* recoverd: Remove unused mask argument from IP allocation functionsMartin Schwenke2013-05-071-3/+0
| | | | | | | | | This is a no-op and is in a separate commit to make the previous commit less cumbersome. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 107e656bbe24f9d21fbaf886a3e9417da4effe5a)
* tests/takeover: Add takeover tests, mostly for NoIPHostOnAllDisabledMartin Schwenke2013-05-074-0/+178
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 7cf63722873a6a7baafd77aa3d8a1989b221dee9)
* recoverd: Fix tunable NoIPTakeoverOnDisabled, rename to NoIPHostOnAllDisabledMartin Schwenke2013-05-074-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This really needs to be per-node. The rename is because nodes with this tunable switched on should drop IPs if they become unhealthy (or disabled in some other way). * Add new flag NODE_FLAGS_NOIPHOST, only used in recovery daemon. * Enhance set_ipflags_internal() and set_ipflags() to setup NODE_FLAGS_NOIPHOST depending on setting of NoIPHostOnAllDisabled and/or whether nodes are disabled/inactive. * Replace can_node_servce_ip() with functions can_node_host_ip() and can_node_takeover_ip(). These functions are the only ones that need to look at NODE_FLAGS_NOIPTAKEOVER and NODE_FLAGS_NOIPHOST. They can make the decision without looking at any other flags due to previous setup. * Remove explicit flag checking in IP allocation functions (including unassign_unsuitable_ips()) and just call can_node_host_ip() and can_node_takeover_ip() as appropriate. * Update test code to handle CTDB_SET_NoIPHostOnAllDisabled. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 1308a51f73f2e29ba4dbebb6111d9309a89732cc)
* tests/takeover: Allow per-node tunable settingsMartin Schwenke2013-05-073-11/+53
| | | | | | | | | Implemented for CTDB_SET_NoIPTakeover. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a1addd89fd9c0390912604097acd028cc24d3483)
* tests: Unit test diff output should use filtered outputMartin Schwenke2013-05-071-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9721aae001b3023e9c8b4af2b143c0db3442d623)
* recoverd: Add debug message when dropping IPs in IP allocationMartin Schwenke2013-05-075-4/+19
| | | | | | | | Update tests accordingly. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 91405282ba4abad4ad8e8c5f7ee4c83c75f38280)