summaryrefslogtreecommitdiff
path: root/ctdb/tests/scripts/integration_real_cluster.bash
blob: 455f1431b986224e61624aa87fd58f692c46119d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# 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
}