ctdb-tests: Conditionally use temporary config file for local daemons
[vlendec/samba-autobuild/.git] / ctdb / tests / README
index 87c7db397e0b9c4a24a5f62ba915fb52787d2f56..92b637ae7681b6b994c2bc9c06ef9b4f37eacc99 100644 (file)
@@ -14,14 +14,35 @@ 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.
+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
------------------
+tests/run_tests.sh
+------------------
 
-The above scripts invoke tests/scripts/run_tests.  This script has a
-lot of command-line switches.  Some of the more useful options
-include:
+This script can be used to manually run all or selected unit tests and
+simple integration tests against local daemons. Test selection is done
+by specifying optional call parameters. If no parameter is given,
+all unit tests and simple integration tests are run.
+
+This runs all unit tests of the "tool" category:
+
+  ./tests/run_tests.sh tool
+
+In order to run a single test, one simply specifies the path of the
+test script to run as the last parameter, e.g.:
+
+  ./tests/run_tests.sh ./tests/eventscripts/00.ctdb.monitor.001
+  ./tests/run_tests.sh ./tests/simple/76_ctdb_pdb_recovery.sh
+
+One can also specify multiple test suites and tests:
+
+  ./tests/run_tests.sh eventscripts tool ./tests/onnode/0001.sh
+
+The script also has number of command-line switches.
+Some of the more useful options include:
 
   -s  Print a summary of tests results after running all tests
 
@@ -41,6 +62,20 @@ include:
 
   -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 <dir> as $TEST_VAR_DIR
+
+      Use the specified temporary temporary/var directory.
+
   -H  No headers - for running single test with other wrapper
 
       This allows tests to be embedded in some other test framework