[Debian-ha-commits] [ocfs2-tools] 03/04: debian/tests: add pcmk cluster test

Valentin Vidic vvidic-guest at moszumanska.debian.org
Sun Jul 17 09:08:29 UTC 2016


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

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

commit ad05a4673b61aa76db724074d088841ed02a2e5b
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Sun Jul 17 02:00:25 2016 +0200

    debian/tests: add pcmk cluster test
---
 debian/tests/control |  4 ++++
 debian/tests/pcmk    | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
index 5a11a07..91f3c3a 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,7 @@
 Depends: ocfs2-tools
 Tests: o2cb
 Restrictions: needs-root, isolation-machine
+
+Depends: ocfs2-tools, corosync, dlm-controld
+Tests: pcmk
+Restrictions: needs-root, isolation-machine
diff --git a/debian/tests/pcmk b/debian/tests/pcmk
new file mode 100644
index 0000000..221bba9
--- /dev/null
+++ b/debian/tests/pcmk
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+set -e
+
+cleanup () {
+  umount /mnt || true
+  [ "$LOOP" ] && losetup -d $LOOP
+  rm -f disk disk.image || true
+  service dlm stop
+  service corosync stop
+}
+
+trap "cleanup" 0 2 3 15
+
+# configure cluster
+echo "=== corosync ==="
+corosync-quorumtool -e 1
+corosync-quorumtool || true
+
+echo "=== dlm ==="
+service dlm restart
+dlm_tool status
+
+# create test disk
+echo "=== losetup ==="
+dd if=/dev/zero of=disk bs=1M count=200 2>&1
+LOOP=$(losetup --find --show disk)
+
+# test tools
+echo "=== mkfs ==="
+mkfs.ocfs2 --cluster-stack=pcmk --cluster-name=debian $LOOP 2>&1
+
+echo "=== pcmk ==="
+echo pcmk > /sys/fs/ocfs2/cluster_stack
+
+echo "=== o2image ==="
+o2image $LOOP disk.image
+ls -l disk.image
+
+echo "=== fsck ==="
+fsck.ocfs2 -f -y $LOOP 2>&1
+
+echo "=== o2cluster ==="
+o2cluster -o $LOOP
+
+echo "=== tunefs ==="
+tunefs.ocfs2 -L disk $LOOP
+
+echo "=== debugfs ==="
+debugfs.ocfs2 -R stats $LOOP
+
+echo "=== o2info ==="
+o2info --volinfo $LOOP
+
+echo "=== mount ==="
+mount $LOOP /mnt
+df /mnt
+
+echo "=== mounted ==="
+mounted.ocfs2 -d
+mounted.ocfs2 -f

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



More information about the Debian-HA-Commits mailing list