summaryrefslogtreecommitdiffstats
path: root/ctdb/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* ctdbd: Add nodes_file member to struct ctdb_contextMartin Schwenke2013-10-221-2/+0
| | | | | | | | | | | | | | | | | This allows ctdb_load_nodes_file() to move to ctdb_server.c and ctdb_set_nlist() to become static. Setting ctdb->nodes_file needs to be done early, before the nodes file is loaded. It is now set from CTDB_BASE instead ETCDIR, so setting CTDB_BASE also needs to be done earlier. Unhack ctdbd_test.c - it no longer needs to define ctdb_load_nodes_file(). Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 20e705e63bd3b20837cc3ac92fdcf2a9650ccfc8)
* tests/integration: Pass --valgrinding option when running under valgrindMartin Schwenke2013-10-221-0/+4
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 913f229508302378212678d98c22606a4954b09c)
* eventscripts: Remove TCP port checks other than the built-in CTDB oneMartin Schwenke2013-10-224-96/+0
| | | | | | | | | | | "ctdb checktcpport" is no longer experimental so the other checkers are no longer required. Remove tests related to the removed checkers. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 50e330d0679614bee2e7bab028436e929f74ca50)
* tests/eventscripts: Run scripts under sh by defaultMartin Schwenke2013-10-221-6/+10
| | | | | | | | | | Some scripts are disabled by default so are no executable. Explicitly running them under sh allows them to be run without having to mess around and make them executable or similar. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9437d4809bfbbb5c6a32a610665333d2f641881d)
* tests/eventscripts: New tests for 20.multipathdMartin Schwenke2013-10-226-0/+110
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 212d4b201c30804f69cffe4b7150d4b74bf2e54f)
* scripts: Remove support for CTDB_OPTIONS configuration variableMartin Schwenke2013-10-221-6/+0
| | | | | | | | | | | Allowing people to put random options in CTDB_OPTIONS complicates some logic (particularly around use of syslog). If we're going to have variables for options then let's make sure we have a variable for each option and make people use them. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e55f3a1577eff0182802b0341d865d961aeae1c7)
* eventscripts: Deprecate NFS_SERVER_MODE, use CTDB_NFS_SERVER_MODE insteadMartin Schwenke2013-10-221-1/+1
| | | | | | | | All CTDB configuration variables should start with CTDB_. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f12658aff125996ae45eea23241d8c3d0567b893)
* tests: When running local tests with run_tests.sh, use fixed TEST_VAR_DIRMartin Schwenke2013-10-221-0/+6
| | | | | | | | Otherwise we end up with lots of useless temporary directories. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 63924ff372b066cd878b79e71f06de4c24c814a2)
* tests/integration: Tweak ctdbd startup optionsMartin Schwenke2013-10-221-5/+1
| | | | | | | | | | * --public-interface is not needed * Add --sloppy-start to speed up restarts Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d0dec5b8e60316701fdd02150c4dd8f01aacbfda)
* tests: If transaction_start fails, try againAmitay Isaacs2013-10-081-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit ed7d999214ee009e480c26410a04fa105028cb8e)
* tests: Make sure test exits with zero status on successful completionAmitay Isaacs2013-10-081-2/+5
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit af4b6b8b3222d2a3c425fcc6833db579d0cd7ffa)
* tests: Re-enable transaction test codeAmitay Isaacs2013-10-041-3/+0
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 929045335212e825deb645cc6c7f97b8a40fdbb3)
* tests: No need to set sequence number when modifying persistent databaseAmitay Isaacs2013-10-041-10/+2
| | | | | | | | | With the new persistent transaction code, sequence numbers will be automatically updated whenever a record is updated. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 961dd5d0acbb971756944ea9f69992020ea7d9fc)
* tests/tool: Remove references in libctdb in file and function namesMartin Schwenke2013-10-046-54/+32
| | | | | | | | | | | | | | | | | Main changes are: libctdb_test.c -> ctdb_test_stubs.c ctdb_tool_libctdb.c -> ctdb_functest.c ctdb_tool_stubby.c is gone, replaced with existing ctdb_test.c. Functions starting with "libctdb_test_" now start with "ctdb_test_stubs_". Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 6182bd0c19f215a997efe5272e633b1b1bd0c882)
* tests/tool: Rework test programs so they no longer expect libctdbMartin Schwenke2013-10-044-285/+291
| | | | | | | | Instead, override controls using preprocessor magic. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 10aac42f30cc0d56dca42ece17d04ccbc321056d)
* tests/tool: Fix some comment typosMartin Schwenke2013-10-042-2/+2
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 59bd4ede15a5958b87e0d253461eb9111885bd2f)
* tools/ctdb: Pass memory context for returning nodes in parse_nodestringAmitay Isaacs2013-10-041-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 1585a8e275b0143e5e46311b3d5e9785119f735f)
* tests: Do not use libctdb code in testsAmitay Isaacs2013-10-042-52/+22
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit ae0d8f432ef98a72c85a6cd42c503b718bef0e4e)
* tests: Remove unused test program ctdb_fetch_lock_onceAmitay Isaacs2013-10-041-146/+0
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 873b9cadbcc363a9e5f450b0a1feb1cf2ce1e6c9)
* tests: Add a simple test to test cluster wide database traverseAmitay Isaacs2013-09-261-0/+73
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 713c9ecc791e3319a2d109838471833de5a158c8)
* tests/simple: Fix the reloadips test to cope with changes to reloadipsMartin Schwenke2013-09-191-3/+3
| | | | | | | | Specifying nodes to reload no longer uses -n. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d921b2756d5f1c4ad7a35fe120f6fda9f5bf5686)
* recoverd: Fix the implementation of CTDB_SRVID_REBALANCE_NODEMartin Schwenke2013-09-191-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation has a few flaws: * A takeover run is called unconditionally when the timer goes even if the recovery master role has moved. This means a node other than the recovery master can incorrectly do a takeover run. * The rebalancing target nodes are cleared in the setup for a takeover run, regardless of whether the takeover run succeeds. * The timer to force a rebalance isn't cleared if another takeover run occurs before the deadline. Any forced rebalancing will happen in the first takeover run and when the timer expires some time later then an unnecessary takeover run will occur. * If the recovery master role moves then the rebalancing data will stay on the original node and affect the next takeover run to occur if the recovery master role should come back to the original node. Instead, store an array of rebalance target nodes in the recovery master context. This is passed as an extra argument to ctdb_takeover_run() each time it is called and is cleared when a takeover run succeeds. The timer hangs off the array of rebalance target nodes, which is cleared if the node isn't the recovery master. This means that it is possible to lose rebalance data if the recovery master role moves. However, that's a difficult problem to solve. The best way of approaching it is probably to try to stop the recovery master role from jumping around unnecesarily when inactive nodes join the cluster. The long term solution is to avoid this nonsense completely. The IP allocation algorithm needs to cache state between runs so that it knows which nodes have just become healthy. This also needs recovery master stability. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c51c1efe5fc7fa668597f2acd435dee16e410fc9)
* tests/eventscripts: Tests for memory checking in 00.ctdbMartin Schwenke2013-09-1110-2/+166
| | | | | | | | ... plus updates to test infrastructure to support. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 4a388fc6bf54636b7e1f6da8e6aa451cddd574f7)
* 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)