[sheepdog] [PATCH 6/6] test: add a test for cluster wide snapshot
Liu Yuan
namei.unix at gmail.com
Fri Aug 24 14:10:17 CEST 2012
From: Liu Yuan <tailai.ly at taobao.com>
Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
tests/030 | 46 ++++++++++++++++++++++++++++++++++++++++++++++
tests/030.out | 7 +++++++
tests/group | 1 +
3 files changed, 54 insertions(+)
create mode 100755 tests/030
create mode 100644 tests/030.out
diff --git a/tests/030 b/tests/030
new file mode 100755
index 0000000..7c5ed98
--- /dev/null
+++ b/tests/030
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# Test farm's cluster snapshot
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
+
+for i in `seq 0 1`; do
+ _start_sheep $i
+done
+
+_wait_for_sheep 2
+
+$COLLIE cluster format -c 2
+
+$COLLIE vdi create test 8M
+
+dd if=/dev/urandom | $COLLIE vdi write test
+$COLLIE cluster snapshot
+$COLLIE vdi read test | md5sum > /tmp/csum.1
+
+dd if=/dev/urandom | $COLLIE vdi write test
+$COLLIE cluster snapshot
+$COLLIE vdi read test | md5sum > /tmp/csum.2
+
+dd if=/dev/urandom | $COLLIE vdi write test
+$COLLIE cluster snapshot -l | _filter_date
+
+$COLLIE cluster snapshot -R 2
+$COLLIE vdi read test | md5sum > /tmp/csum.22
+
+$COLLIE cluster snapshot -R 1
+$COLLIE vdi read test | md5sum > /tmp/csum.11
+
+diff -u /tmp/csum.1 /tmp/csum.11
+diff -u /tmp/csum.2 /tmp/csum.22
diff --git a/tests/030.out b/tests/030.out
new file mode 100644
index 0000000..605e0c1
--- /dev/null
+++ b/tests/030.out
@@ -0,0 +1,7 @@
+QA output created by 030
+using backend farm store
+Index Snapshot Time
+1 DATE
+2 DATE
+Cluster restore to the snapshot 2
+Cluster restore to the snapshot 1
diff --git a/tests/group b/tests/group
index 6a790b0..babeb3d 100644
--- a/tests/group
+++ b/tests/group
@@ -41,3 +41,4 @@
027 auto quick store
028 auto quick store
029 auto quick vdi
+030 auto quick store
--
1.7.10.2
More information about the sheepdog
mailing list