summaryrefslogtreecommitdiffstats
path: root/debian/tests/pacemaker-cluster-init.sh
blob: a3cf349a68c25337f33f507f0172a953fd5118f9 (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
#!/bin/sh

set -ex

# https://bugs.launchpad.net/bugs/1828228
ulimit -H -l unlimited 2>/dev/null || {
	echo "test disabled for unprivileged namespaces"
	exit 77
}

# ufw currently broken without /sbin/iptables
if ! ufw status; then
	test -e /sbin/iptables  || ln -s /usr/sbin/iptables /sbin/iptables
	test -e /sbin/ip6tables || ln -s /usr/sbin/ip6tables /sbin/ip6tables
fi

service corosync stop

crm cluster init --yes --name=autopkgtest --unicast

crm cluster geo_init --yes --clusters=autopkgtest=127.2.2.2 --tickets=ticket1
crm resource start g-booth
sleep 5

crm status

crm status | grep -q booth-ip.*Started
crm status | grep -q booth-site.*Started

: INFO all tests OK
exit 0