[Debian-ha-commits] [sbd] 15/16: debian/tests: add test to fence current host
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Fri Jun 23 16:49:27 UTC 2017
This is an automated email from the git hooks/post-receive script.
vvidic-guest pushed a commit to branch master
in repository sbd.
commit 00ac22173670d9606b742c312d8d17083c784024
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date: Fri Jun 23 18:31:52 2017 +0200
debian/tests: add test to fence current host
---
debian/tests/control | 4 ++++
debian/tests/fence | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/debian/tests/control b/debian/tests/control
index 68829b8..7275895 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -5,3 +5,7 @@ Tests: watch
Restrictions: needs-root, allow-stderr, isolation-machine
Tests: regression
+
+Depends: @, pacemaker, crmsh
+Restrictions: needs-root, isolation-machine
+Tests: fence
diff --git a/debian/tests/fence b/debian/tests/fence
new file mode 100755
index 0000000..3df643e
--- /dev/null
+++ b/debian/tests/fence
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+if [ "$AUTOPKGTEST_REBOOT_MARK" = fenced ]; then
+ echo "fence was successfull"
+ exit 0
+fi
+
+# create test disk
+echo "=== losetup ==="
+DISK=$AUTOPKGTEST_TMP/disk
+dd if=/dev/zero of=$DISK bs=1M count=10 2>&1
+LOOP=$(losetup --find --show $DISK)
+
+echo "=== create ==="
+sbd -d $LOOP create
+echo "SBD_OPTS='-d $LOOP -W -W'" > /etc/default/sbd
+
+echo "=== cluster ==="
+service corosync start
+service pacemaker start
+sleep 60
+service sbd status
+crm status
+
+echo "=== crm ==="
+crm configure primitive sbd stonith:external/sbd params sbd_device=$LOOP
+crm configure property stonith-enabled=true
+crm configure show
+
+echo "=== fence ==="
+/tmp/autopkgtest-reboot-prepare fenced
+crm --force node fence $(uname -n)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/sbd.git
More information about the Debian-HA-Commits
mailing list