1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00
samba-mirror/ctdb/tests/scripts/integration_real_cluster.bash
Martin Schwenke df6800e330 ctdb-tests: Convert local daemons include file into top-level include
Do the same with the alternative code for real clusters.

Both of these can now be used by other test suites.

Fix some basic shellcheck warnings (e.g. avoid word-splitting by
quoting) while moving code and add the new files to the shellcheck
test.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-09-26 04:45:37 +00:00

65 lines
1.1 KiB
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_stop_all ()
{
onnode -p all "$CTDB_TEST_WRAPPER" _service_ctdb stop
}
ctdb_start_all ()
{
onnode -p all "$CTDB_TEST_WRAPPER" _service_ctdb start
}
start_ctdb_1 ()
{
onnode "$1" "$CTDB_TEST_WRAPPER" _service_ctdb start
}
stop_ctdb_1 ()
{
onnode "$1" "$CTDB_TEST_WRAPPER" _service_ctdb stop
}
restart_ctdb_1 ()
{
onnode "$1" "$CTDB_TEST_WRAPPER" _service_ctdb restart
}