[Debian-ha-commits] [sbd] 02/16: debian/tests: add test for watch command

Valentin Vidic vvidic-guest at moszumanska.debian.org
Fri Jun 23 16:49:26 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 72754f8891b989ed4d371a84737d0c8ade113947
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Fri Jun 23 12:47:40 2017 +0200

    debian/tests: add test for watch command
---
 debian/tests/control |  2 +-
 debian/tests/watch   | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/debian/tests/control b/debian/tests/control
index 4695034..1393e08 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,3 @@
 Depends: @
 Restrictions: needs-root, allow-stderr, isolation-machine
-Tests: regression
+Tests: watch, regression
diff --git a/debian/tests/watch b/debian/tests/watch
new file mode 100755
index 0000000..9adc198
--- /dev/null
+++ b/debian/tests/watch
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+set -e
+
+DISK=$AUTOPKGTEST_TMP/disk
+NODE=autopkgtest
+
+cleanup () {
+  [ "$LOOP" ] && losetup -d $LOOP
+}
+
+trap "cleanup" 0 2 3 15
+
+# create test disk
+echo "=== losetup ==="
+dd if=/dev/zero of=$DISK bs=1M count=10 2>&1
+LOOP=$(losetup --find --show $DISK)
+
+echo "=== create ==="
+sbd -n $NODE -d $LOOP create
+
+echo "=== allocate ==="
+sbd -n $NODE -d $LOOP allocate $NODE
+
+echo "=== list ==="
+sbd -n $NODE -d $LOOP list
+
+echo "=== dump ==="
+sbd -n $NODE -d $LOOP dump
+
+echo "=== watch ==="
+mkdir -p /var/lib/pacemaker/cores
+sbd -n $NODE -d $LOOP -W -W watch
+pgrep -a sbd
+
+echo "=== test ==="
+sbd -n $NODE -d $LOOP message $NODE test
+
+echo "=== exit ==="
+sbd -n $NODE -d $LOOP message $NODE exit
+
+# wait for exit
+for i in 1 2 3 4 5; do
+  pgrep sbd >/dev/null || break
+  sleep 1
+done
+
+if pgrep -a sbd; then
+  echo sbd did not exit
+  exit 1
+fi

-- 
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