[Debian-ha-commits] [ocfs2-tools] 02/02: debian/tests: add tool tests for o2cb stack

Valentin Vidic vvidic-guest at moszumanska.debian.org
Fri Jul 8 21:46:39 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 1f05264a2223fa9118d94fc78493808d3334ee4b
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Fri Jul 8 23:45:08 2016 +0200

    debian/tests: add tool tests for o2cb stack
---
 debian/tests/o2cb | 66 +++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 59 insertions(+), 7 deletions(-)

diff --git a/debian/tests/o2cb b/debian/tests/o2cb
index 579d7b9..3450e1a 100644
--- a/debian/tests/o2cb
+++ b/debian/tests/o2cb
@@ -3,31 +3,83 @@
 set -e
 
 cleanup () {
+  umount /mnt || true
+  [ "$LOOP" ] && losetup -d $LOOP
+  rm -f disk disk.image || true
   service o2cb stop
 }
 
 trap "cleanup" 0 2 3 15
 
 # configure cluster
+HOSTNAME=$(hostname)
+
 cat >/etc/ocfs2/cluster.conf <<EOF
+cluster:
+        node_count = 1
+        name = ocfs2
+
 node:
         ip_port = 7777
         ip_address = 127.0.0.1
         number = 0
-        name = localhost
+        name = $HOSTNAME
         cluster = ocfs2
-
-cluster:
-        node_count = 1
-        name = ocfs2
 EOF
 
-sed -i -e 's/^O2CB_ENABLED=.*/O2CB_ENABLED=true/' /etc/default/o2cb
-
 # start cluster
+sed -i -e 's/^O2CB_ENABLED=.*/O2CB_ENABLED=true/' /etc/default/o2cb
 service o2cb restart
 
 # check cluster
+echo "=== dlmfs ==="
 grep '^ocfs2_dlmfs /dlm' /proc/mounts
+
+echo "=== lsmod ==="
 lsmod | grep ocfs2_stack_o2cb
+
+echo "=== o2hbmonitor ==="
 pgrep -a o2hbmonitor
+
+# print info
+echo "=== o2cluster ==="
+o2cluster -r
+
+echo "=== o2cb_ctl ==="
+o2cb_ctl -I -n $HOSTNAME
+
+# 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=o2cb --cluster-name=ocfs2 $LOOP 2>&1
+
+echo "=== o2image ==="
+o2image $LOOP disk.image
+ls -l disk.image
+
+echo "=== fsck ==="
+fsck.ocfs2 $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