diff options
author | Martin Schwenke <martin@meltin.net> | 2013-11-29 14:07:43 +1100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-12-05 00:43:55 +0100 |
commit | f67a1043b381f623ec9c97ac137568ca7ab6cd8a (patch) | |
tree | b6180d84f76255466c6b348fa197435dcc3ba03d /ctdb | |
parent | f05db5edc434da61bc7cd7233c5b9cb61cd888bf (diff) | |
download | samba-f67a1043b381f623ec9c97ac137568ca7ab6cd8a.tar.gz samba-f67a1043b381f623ec9c97ac137568ca7ab6cd8a.tar.xz samba-f67a1043b381f623ec9c97ac137568ca7ab6cd8a.zip |
ctdb/tests/integration: Decentralise the daemon restart code
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/tests/scripts/integration.bash | 15 | ||||
-rw-r--r-- | ctdb/tests/simple/scripts/local_daemons.bash | 6 |
2 files changed, 14 insertions, 7 deletions
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index 4d22f4150f..665fc7dd69 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -449,6 +449,12 @@ _restart_ctdb () fi } +# Restart CTDB on all nodes. Override for local daemons. +_restart_ctdb_all () +{ + onnode -p all $CTDB_TEST_WRAPPER _restart_ctdb "$@" +} + # Nothing needed for a cluster. Override for local daemons. setup_ctdb () { @@ -457,7 +463,7 @@ setup_ctdb () restart_ctdb () { - # "$@" is passed to ctdbd start. + # "$@" is passed to restart_ctdb_all. echo -n "Restarting CTDB" if $ctdb_test_restart_scheduled ; then @@ -467,12 +473,7 @@ restart_ctdb () local i for i in $(seq 1 5) ; do - if [ -n "$CTDB_NODES_SOCKETS" ] ; then - daemons_stop - daemons_start "$@" - else - onnode -p all $CTDB_TEST_WRAPPER _restart_ctdb "$@" - fi || { + _restart_ctdb_all "$@" || { echo "Restart failed. Trying again in a few seconds..." sleep_for 5 continue diff --git a/ctdb/tests/simple/scripts/local_daemons.bash b/ctdb/tests/simple/scripts/local_daemons.bash index 6bd2138a82..7c3407f8aa 100644 --- a/ctdb/tests/simple/scripts/local_daemons.bash +++ b/ctdb/tests/simple/scripts/local_daemons.bash @@ -127,3 +127,9 @@ maybe_stop_ctdb () daemons_stop fi } + +_restart_ctdb_all () +{ + daemons_stop + daemons_start "$@" +} |