[Debian-ha-commits] [booth] 11/12: d/tests: test booth service and pacemaker resource

Valentin Vidic vvidic-guest at moszumanska.debian.org
Tue Jun 27 12:17:13 UTC 2017


This is an automated email from the git hooks/post-receive script.

vvidic-guest pushed a commit to branch master
in repository booth.

commit cddeabd3654ffa698bc2932c00256a44413dbb32
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Tue Jun 27 14:10:12 2017 +0200

    d/tests: test booth service and pacemaker resource
---
 debian/tests/boothd    | 34 ++++++++++++++++++++++++++++++++++
 debian/tests/control   |  7 +++++++
 debian/tests/pacemaker | 44 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 85 insertions(+)

diff --git a/debian/tests/boothd b/debian/tests/boothd
new file mode 100755
index 0000000..438c1fe
--- /dev/null
+++ b/debian/tests/boothd
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+printf "=== config ===\n"
+booth-keygen
+cat <<EOF | tee /etc/booth/booth.conf
+authfile = /etc/booth/authkey
+site = 127.0.0.1
+ticket = "ticket-A"
+EOF
+
+printf "\n=== service ===\n"
+systemctl daemon-reload
+systemctl restart booth
+systemctl status booth at booth
+
+printf "\n=== status ===\n"
+booth status
+booth list
+
+printf "\n=== grant ===\n"
+booth grant ticket-A 2>&1
+booth list
+
+printf "\n=== revoke ===\n"
+booth revoke ticket-A 2>&1
+booth list
+
+printf "\n=== geostore ===\n"
+geostore set status GOOD 2>&1
+geostore get status
+geostore list
+geostore delete status
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..92966cd
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,7 @@
+Depends: booth, pacemaker-cli-utils
+Restrictions: needs-root, isolation-container
+Tests: boothd
+
+Depends: booth-pacemaker, crmsh
+Restrictions: needs-root, isolation-container
+Tests: pacemaker
diff --git a/debian/tests/pacemaker b/debian/tests/pacemaker
new file mode 100755
index 0000000..4ec3414
--- /dev/null
+++ b/debian/tests/pacemaker
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+set -e
+
+printf "=== config ===\n"
+booth-keygen
+cat <<EOF | tee /etc/booth/booth.conf
+authfile = /etc/booth/authkey
+site = 127.0.0.1
+ticket = "ticket-A"
+EOF
+
+printf "\n=== cluster ===\n"
+service corosync start
+service pacemaker start
+sleep 60
+
+crm configure property stonith-enabled=false
+crm configure property no-quorum-policy=ignore
+crm configure primitive booth ocf:pacemaker:booth-site
+crm configure primitive dummy ocf:heartbeat:Dummy
+crm configure rsc_ticket ticket-A_dummy ticket-A: dummy
+crm configure show
+sleep 10
+crm status
+
+printf "\n=== booth ===\n"
+booth status
+booth list
+
+printf "\n=== grant ===\n"
+crm site ticket show ticket-A
+crm status | grep dummy.*Stopped
+crm --force site ticket grant ticket-A
+sleep 10
+crm site ticket show ticket-A
+crm status | grep dummy.*Started
+
+printf "\n=== revoke ===\n"
+crm site ticket standby ticket-A
+sleep 10
+crm status | grep dummy.*Stopped
+crm --force site ticket revoke ticket-A
+crm site ticket show ticket-A

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/booth.git



More information about the Debian-HA-Commits mailing list