diff options
| author | Martin Schwenke <martin@meltin.net> | 2009-06-19 11:40:09 +1000 |
|---|---|---|
| committer | Martin Schwenke <martin@meltin.net> | 2009-06-19 11:40:09 +1000 |
| commit | 62871fbcd5dedd5b4a025e5ef9e93eb231afb14e (patch) | |
| tree | e13fde768a7bc0585dd4988aef0ef1868bec3eba /ctdb/tests/scripts | |
| parent | 1f3a602b88f033ca7e2a7176bd7ae30c03d88ab9 (diff) | |
| download | samba-62871fbcd5dedd5b4a025e5ef9e93eb231afb14e.tar.gz samba-62871fbcd5dedd5b4a025e5ef9e93eb231afb14e.tar.xz samba-62871fbcd5dedd5b4a025e5ef9e93eb231afb14e.zip | |
Clean up handling the of CTDB restarts in testcases.
Glitches during restarts of the CTDB cluster have been causing some
tests to fail. This is because restarts are initiated in the body of
many tests. This adds a simple function ctdb_restart_when_done, which
schedules a restart using an existing hook in the test exit code.
This function is now used in tests that need to restart CTDB.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit d440e83bb4f0c19c085915d0f0e87cc0dabbc569)
Diffstat (limited to 'ctdb/tests/scripts')
| -rw-r--r-- | ctdb/tests/scripts/ctdb_test_functions.bash | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ctdb/tests/scripts/ctdb_test_functions.bash b/ctdb/tests/scripts/ctdb_test_functions.bash index 1930ae163a..210e6c4853 100644 --- a/ctdb/tests/scripts/ctdb_test_functions.bash +++ b/ctdb/tests/scripts/ctdb_test_functions.bash @@ -591,6 +591,10 @@ setup_ctdb () restart_ctdb () { + if [ "$1" = "-v" ] ; then + echo "Restarting CTDB (scheduled)..." + fi + if [ -n "$CTDB_NODES_SOCKETS" ] ; then daemons_stop daemons_start $CTDB_TEST_NUM_DAEMONS @@ -615,6 +619,13 @@ restart_ctdb () echo "ctdb is ready" } +ctdb_restart_when_done () +{ + ctdb_test_exit_hook_add restart_ctdb -v +} + + + ####################################### install_eventscript () |
