summaryrefslogtreecommitdiffstats
path: root/debian/tests/pacemaker-cluster-init.sh
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests/pacemaker-cluster-init.sh')
-rwxr-xr-xdebian/tests/pacemaker-cluster-init.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/tests/pacemaker-cluster-init.sh b/debian/tests/pacemaker-cluster-init.sh
new file mode 100755
index 0000000..a3cf349
--- /dev/null
+++ b/debian/tests/pacemaker-cluster-init.sh
@@ -0,0 +1,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