Introduction ------------ For a developer, the simplest way of running most tests on a local machine from within the git repository is: make test This runs all unit tests (onnode, takeover, tool, eventscripts) and the tests against local daemons (simple) using the script tests/run_tests.sh. When running tests against a real or virtual cluster the script tests/run_cluster_tests.sh can be used. This runs all integration tests (simple, complex). Both of these scripts can also take a list of tests to run. You can also pass options, which are then passed to run_tests. However, if you just try to pass options to run_tests then you lose the default list of tests that are run. You can't have everything... scripts/run_tests ----------------- The above scripts invoke tests/scripts/run_tests. This script has a lot of command-line switches. Some of the more useful options include: -s Print a summary of tests results after running all tests -l Use local daemons for integration tests This allows the tests in "simple" to be run against local daemons. All integration tests communicate with cluster nodes using onnode or the ctdb tool, which both have some test hooks to support local daemons. By default 3 daemons are used. If you want to use a different number of daemons then do not use this option but set TEST_LOCAL_DAEMONS to the desired number of daemons instead. The -l option just sets TEST_LOCAL_DAEMONS to 3... :-) -e Exit on the first test failure -C Clean up - kill daemons and remove $TEST_VAR_DIR when done Tests uses a temporary/var directory for test state. By default, this directory is not removed when tests are complete, so you can do forensics or, for integration tests, re-run tests that have failed against the same directory (with the same local daemons setup). So this option cleans things up. Also kills local daemons associated with directory. -V Use