summaryrefslogtreecommitdiffstats
path: root/ctdb/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* ctdb/tests/scripts: Promote scripts/run_testsMartin Schwenke2013-12-052-317/+304
| | | | | | | The wrapper is not needed anymore. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/scripts: Simplify the top-level test scriptsMartin Schwenke2013-12-052-46/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment run_tests.sh has quite fragile argument processing. It needs that annoying "--" between options and tests. The random default (mktemp -d) for TEST_VAR_DIR is wrong and is worked around in various places. Instead: * Change the default behaviour to print a summary, add new option -N to turn off summary, and remove old -s option. * Change the default behaviour to run integration tests with local daemons, add new options -c to run on a cluster, remove old -l option. * Make $testdir/var the default if the tests are not installed, and $(mktemp -d ) the default if tests are installed. * Move the default tests for local/cluster into scripts/run_tests. run_tests.sh (and the run_cluster_tests.sh symlink) should behave as before but with slightly more reasonable defaults. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/scripts: Sort command-line optionsMartin Schwenke2013-12-051-16/+16
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/integration: Decentralise the daemon restart codeMartin Schwenke2013-12-052-7/+14
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/integration: Update daemons shutdown pseudo-testMartin Schwenke2013-12-053-3/+16
| | | | | | | | Don't scatter the TEST_LOCAL_DAEMONS logic around the code. Limit it to the local daemons file. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/simple: Local daemons version of setup_ctdb() overridesMartin Schwenke2013-12-052-4/+3
| | | | | | | | setup_ctdb() doesn't need to do anything on a cluster. To avoid a conditional, just override it for local daemons. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/integration: Remove some unused functionsMartin Schwenke2013-12-051-43/+0
| | | | | | | This was the start of some refactorisation that was never completed. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/integration: Remove the time logging codeMartin Schwenke2013-12-052-62/+0
| | | | | | | | This hasn't been required for a long time and is probably broken. If it is needed in future then we know where to find it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/simple: Move the local daemons code to its own fileMartin Schwenke2013-12-053-124/+125
| | | | | | | This is just a straight move. The clever stuff will follow. :-) Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/integration: Update NFS tickles test and supporting codeMartin Schwenke2013-12-052-176/+17
| | | | | | | | | | | | | | | This currently requires an eventscript to be dynamically installed. This eventscript is only used to help determine when a monitor event has occurred. This code is horrible and fragile. A better way is to just monitor the output of "ctdb scriptstatus". When changes it changes then a monitor event has occurred. Also remove the old code that checks for tickle information in shared storage. CTDB hasn't done things this way for a long time. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb:tests: in the stub "ip link show" command use echo instead of catMichael Adam2013-11-281-4/+2
| | | | | | | | | | | | This case of "ip link show" does not break autobuild with "Broken pipe" messages, but let's be consistent. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu Nov 28 09:23:03 CET 2013 on sn-devel-104
* ctdb:test: remove unused ip2ipmask from integration.bashMichael Adam2013-11-281-7/+0
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:tests:76_ctdb_pdb_recovery: change from using ctdb pstore to ctdb ptrans.Michael Adam2013-11-281-4/+2
| | | | | | | | | | This removes the requirement to create a temporary file and hence makes this test runnable against local daemons and against a real cluster without further changes. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:tests:76_ctdb_pdb_recovery: fix a typo in a messageMichael Adam2013-11-281-1/+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:76_ctdb_pdb_recovery: fix a typo in a messageMichael Adam2013-11-281-1/+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: in the stub ip command, avoid broken pipe by using echo instead ↵Michael Adam2013-11-281-9/+3
| | | | | | | | | | | | of cat This fixes running "make autotest" from autobuild, since it prevents irritating error output in delete_ip_from_iface() when calling ip addr list ... | grep -Fq "inet ..." . Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* 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)