2011-06-28 11:29:13 +04:00
eventscript unit tests
======================
This directory contains some eventscript unit tests for CTDB. These
tests can be run as a non-privileged user. There are a lot of stub
2012-04-20 10:37:09 +04:00
implementations of commands (located in stubs/) used to make the
2011-06-28 11:29:13 +04:00
eventscripts think they're running against a real system.
2012-04-20 10:37:09 +04:00
Test case filenames look like:
<eventscript>.<event>.NNN.sh
The test helper functions will run <eventscript> with specified
2015-06-17 10:26:21 +03:00
options. If using the simple_test() helper function then the 1st
<event> argument is automatically passed. When simple_test_event() is
used the event name must be explicitly passed as the 1st argument -
this is more flexible and supports multiple events per test.
2012-04-20 10:37:09 +04:00
2011-06-28 11:29:13 +04:00
Examples:
2012-04-20 10:37:09 +04:00
* ../run_tests.sh .
2011-06-28 11:29:13 +04:00
Run all tests, displaying minimal output.
2012-04-20 10:37:09 +04:00
* ../run_tests.sh -s .
2011-06-28 11:29:13 +04:00
Run all tests, displaying minimal output and a summary.
2012-04-20 10:37:09 +04:00
* ../run_tests.sh -s ./10.interface.*.sh
2011-06-28 11:29:13 +04:00
2012-04-20 10:37:09 +04:00
Run all the tests against the 10.interface eventscript.
2011-06-28 11:29:13 +04:00
2012-04-20 10:37:09 +04:00
* ../run_tests.sh -v -s .
2011-06-28 11:29:13 +04:00
Run all tests, displaying extra output and a summary.
2012-04-20 10:37:09 +04:00
* ../run_tests.sh -sq .
2011-06-28 11:29:13 +04:00
Run all tests, displaying only a summary.
2012-04-20 10:37:09 +04:00
* ../run_tests.sh -X ./10.interface.startup.002.sh
2011-06-28 11:29:13 +04:00
Run a test and have the eventscript itself run with "sh -x". This
will usually make a test fail because the (undesirable) trace output
will be included with the output of the eventscript. However, this
2012-04-20 10:37:09 +04:00
is useful for finding out why a test might be failing.