diff options
author | Martin Schwenke <martin@meltin.net> | 2019-12-11 21:44:28 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2020-02-18 02:56:38 +0000 |
commit | dc076b835f30b1067155e2f440a3386331d15b5a (patch) | |
tree | c239ed8bb5f000ed28990d6d5f1d8f76ee3eb673 /ctdb/tests/scripts/integration.bash | |
parent | a20403adf871d2c1a646be0737935f85b55f8779 (diff) | |
download | samba-dc076b835f30b1067155e2f440a3386331d15b5a.tar.gz |
ctdb-tests: Rationalise node stop/start/restart
Separate functions are not needed for stopping/starting/restarting
individual nodes. The stop and start functions essentially just use
onnode, though for local daemons this is embedded in local_daemons.sh.
So, just provide one stop and one start function that takes an
optional nodespec, defaulting to all nodes.
Restarting becomes common.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tests/scripts/integration.bash')
-rw-r--r-- | ctdb/tests/scripts/integration.bash | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index 51e9c7cb822..adf8d0363cf 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -50,7 +50,7 @@ ctdb_test_exit () unset ctdb_test_exit_hook echo "Stopping cluster..." - ctdb_stop_all + ctdb_nodes_stop exit $status } @@ -92,7 +92,7 @@ ctdb_test_init () { trap "ctdb_test_exit" 0 - ctdb_stop_all >/dev/null 2>&1 || true + ctdb_nodes_stop >/dev/null 2>&1 || true echo "Configuring cluster..." setup_ctdb "$@" || exit 1 @@ -111,6 +111,13 @@ ctdb_test_skip_on_cluster () fi } + +ctdb_nodes_restart () +{ + ctdb_nodes_stop "$@" + ctdb_nodes_start "$@" +} + ######################################## # Sets: $out, $outfile @@ -568,9 +575,9 @@ wait_until_node_has_no_ips () ctdb_init () { - ctdb_stop_all >/dev/null 2>&1 || : + ctdb_nodes_stop >/dev/null 2>&1 || : - ctdb_start_all || ctdb_test_error "Cluster start failed" + ctdb_nodes_start || ctdb_test_error "Cluster start failed" wait_until_ready || ctdb_test_error "Cluster didn't become ready" |