1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
samba-mirror/ctdb/tests/scripts/integration_real_cluster.bash
Martin Schwenke dc076b835f 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>
2020-02-18 02:56:38 +00:00

54 lines
981 B
Bash

# Hey Emacs, this is a -*- shell-script -*- !!! :-)
#######################################
# Enables all of the event scripts used in cluster tests, except for
# the mandatory scripts
_ctdb_enable_cluster_test_event_scripts ()
{
local scripts="
06.nfs
10.interface
49.winbind
50.samba
60.nfs
"
local s
for s in $scripts ; do
try_command_on_node all ctdb event script enable legacy "$s"
done
}
setup_ctdb ()
{
_ctdb_enable_cluster_test_event_scripts
}
#######################################
_service_ctdb ()
{
cmd="$1"
if [ -e /etc/redhat-release ] ; then
service ctdb "$cmd"
else
/etc/init.d/ctdb "$cmd"
fi
}
# Stop/start CTDB on all nodes. Override for local daemons.
ctdb_nodes_stop ()
{
local nodespec="${1:-all}"
onnode -p "$nodespec" "$CTDB_TEST_WRAPPER" _service_ctdb stop
}
ctdb_nodes_start ()
{
local nodespec="${1:-all}"
onnode -p "$nodespec" "$CTDB_TEST_WRAPPER" _service_ctdb start
}