From 62871fbcd5dedd5b4a025e5ef9e93eb231afb14e Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 19 Jun 2009 11:40:09 +1000 Subject: 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 (This used to be ctdb commit d440e83bb4f0c19c085915d0f0e87cc0dabbc569) --- ctdb/tests/scripts/ctdb_test_functions.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ctdb/tests/scripts') 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 () -- cgit