summaryrefslogtreecommitdiffstats
path: root/ctdb/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* ctdb:tests: ignore SIGPIPE in unit testsMichael Adam2013-11-281-0/+2
| | | | | | | | | | | This makes scripts called in the unit tests behave like when called from ctdbd which ignodes SIGPIPE. This also makes the scrips behave the same when called from "make autotest" directly and via autobuild (python). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:tests: add path of ip command to extra output in the error caseMichael Adam2013-11-281-0/+1
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:tests: remove old now unused script test/recover.shMichael Adam2013-11-281-107/+0
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb:tests/simple: Nobody looks at /tmp/recloop.out so use /dev/null insteadMartin Schwenke2013-11-271-1/+1
| | | | | | | | | | | Otherwise this should use mktemp, something should look at the output and the file should be removed. :-) Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Nov 27 20:39:00 CET 2013 on sn-devel-104
* ctdb:tests: run_tests should ignore bogus test directoriesMartin Schwenke2013-11-271-0/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb:tests: Add -S option to support socket wrapperMartin Schwenke2013-11-271-1/+9
| | | | | | | | Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Signed-off-by: Martin Schwenke <martin@meltin.net> Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb:tests: Rework unit test result filteringMartin Schwenke2013-11-274-19/+18
| | | | | | | Using a variable is too fragile, so use a function instead. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb:tests: remove unused setup_nmap_output_filter()Martin Schwenke2013-11-271-5/+0
| | | | | | | The tests that used it have gone. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb:tests/integration: Be more careful when killing ctdbdMartin Schwenke2013-11-271-1/+1
| | | | | | | | Also match $TEST_VAR_DIR in the socket name. This means that we'll only ever kill ctdbd process belong to our own test run. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests/integration: Neaten up some of the persistent database testsMartin Schwenke2013-11-274-150/+171
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests/takeover: Fix bogus test descriptionMartin Schwenke2013-11-271-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests/simple: User sleep_for() instead of sleepMartin Schwenke2013-11-271-2/+2
| | | | | | | Progress... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests/simple: Update persistent DB testsMartin Schwenke2013-11-273-13/+13
| | | | | | | | | | | * Low level DB checks should ignore the sequence number record. * A restart is needed after messing with the RecoverPDBBySeqNum tunable. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tools/ctdb: New ptrans commandMartin Schwenke2013-11-271-0/+127
| | | | | | | | Also add test. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests/integration: try_command_on_node() shouldn't lose onnode optionsMartin Schwenke2013-11-271-1/+1
| | | | | | | | Currently it only passes the last (non -v) option seen. It should pass them all. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: CTDB tool should always be invoked as $CTDB instad of ctdbAmitay Isaacs2013-11-277-92/+92
| | | | | | | | $CTDB_TEST_WRAPPER is required only to run test functions or test binaries on remote nodes. For running ctdb command, $CTDB is sufficient. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: No need to run onnode in parallel for single nodeAmitay Isaacs2013-11-273-6/+6
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: Remove -q option to try_command_on_nodeAmitay Isaacs2013-11-2712-99/+99
| | | | | | | This option is always passed to onnode by default. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: Coverity fixesAmitay Isaacs2013-11-191-8/+14
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Nov 19 19:06:51 CET 2013 on sn-devel-104
* tests: Fix calling of ctdb tool from testAmitay Isaacs2013-11-071-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 9381c33dfd40192b7532d942059c2959dfae059d)
* Revert "tests: If transaction_start fails, try again"Amitay Isaacs2013-11-071-1/+1
| | | | | | | | | | | | This reverts commit ed7d999214ee009e480c26410a04fa105028cb8e. This is not necessary since ctdb_transaction_start() now will return NULL only when there is a failure and not when another transaction is currently active. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 46615c8e0e63291605d76a6d35f1a93180718c36)
* tests/complex: Remove CTDB_NFS_SKIP_SHARE_CHECK testMartin Schwenke2013-10-291-129/+0
| | | | | | | | | | This is a needlessly complex way of testing the same thing as the eventscripts unit tests 60.nfs.monitor.161.sh and 60.nfs.monitor.162.sh. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d1674aad224f8f0c9a03c3cd38a647318ba0f03e)
* tests/complex: Remove CTDB_SAMBA_SKIP_SHARE_CHECK testMartin Schwenke2013-10-291-134/+0
| | | | | | | | | | | | | | This is adequately covered by eventscripts unit tests 50.samba.monitor.105.sh and 50.samba.monitor.106.sh. This test is broken if CTDB_SAMBA_CHECK_PORTS is not specified in the CTDB configuration. Fixing it is hard and involves adding a more complex stub for testparm. We already have that in the eventscript unit tests above. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 81b94fbb7495ac3204f1a84c673c8babf04663bc)
* eventscripts: Rewrite the smb.conf cache file handlingMartin Schwenke2013-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The background update is never guaranteed to complete before the cache is used, so don't bother trying it at the beginning. Instead, put a timeout on a foreground update. If the foreground update fails: * If there's no available cache file then die. * If there is a previous cache file then use it and log a warning. * Do a background update at the end of the monitor event. Also remove commas in the "smb ports" list before use, since (newer?) testparm seem to insert commas into the default value. Update the associated test to add a comma. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 8c6f511254ecb0381a609b37e3a0ee6e5ec5d562)
* tools/onnode: Fix healthy/ok node handlingMartin Schwenke2013-10-293-17/+16
| | | | | | | | | | | | | | | | | | | | | | | This bit-rotted a long time ago when the "ThisNode" column was added to "ctdb -Y status" output. The fake "ctdb -Y status" output in the test was never updated to reflect this change. Instead of making sure that all columns are "0", just check that they're not "1". This implicitly ignores "Y" and "N" in this "ThisNode" column without having to do anything else clever. Also update associated tests. The main "ctdb ok" test had a duplicate opening line for a here document, which was tickled by this change. This fixes samba bz#8122. Signed-off-by: Martin Schwenke <martin@meltin.net> onnode test fixup Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 01a46205c3a3d6609dc0b0324319b89667dffa32)
* build: Move the default CTDB socket from /tmp to /var/run/ctdbAmitay Isaacs2013-10-251-4/+0
| | | | | | | | | | | | | | | | | Use /var/run/ctdb/ctdbd.socket because there might be other daemons that need sockets in the future. The local daemons test code to create a link for the default convenience socket has to be removed because the link can't be created as a regular user in the new location. This should be OK since all calls to the ctdb tool in the test code should be wrapped in onnode. When debugging tests, a developer will have to set CTDB_SOCKET by hand. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Pair-programmed-with: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit dc67a4e24af9d07aead2a1710eeaf5d6cc409201)
* common: New function mkdir_p()Martin Schwenke2013-10-251-4/+0
| | | | | | | | | Behaves like mkdir -p. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit afe2145d91725daf1399f0a24f1cddcf65f0ec31)
* 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)