[sheepdog] [PATCH v3 8/8] tests: add 056 to test disk failure with node event change

Liu Yuan namei.unix at gmail.com
Wed Mar 27 10:11:36 CET 2013


From: Liu Yuan <tailai.ly at taobao.com>

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 tests/056     |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/056.out |   19 +++++++++++++++++++
 tests/group   |    1 +
 3 files changed, 66 insertions(+)
 create mode 100755 tests/056
 create mode 100644 tests/056.out

diff --git a/tests/056 b/tests/056
new file mode 100755
index 0000000..24757e3
--- /dev/null
+++ b/tests/056
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# Test md disk failure with node change events
+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 0 1 2; do
+	_start_sheep $i
+done
+_wait_for_sheep 3
+$COLLIE cluster format
+sleep 1
+$COLLIE vdi create test 200M -P
+
+# node event after disk failure
+rm $STORE/0/d0 -rf
+dd if=/dev/urandom | $COLLIE vdi write test &
+sleep 1
+_start_sheep 3
+_wait_for_sheep 4
+_wait_for_sheep_recovery 0
+wait # collie
+$COLLIE vdi check test
+$COLLIE cluster info | _filter_cluster_info
+
+# disk failures after node event
+rm $STORE/1/d0 -rf
+dd if=/dev/zero | $COLLIE vdi write test &
+sleep 1
+_kill_sheep 2
+sleep 1
+rm $STORE/1/d1 -rf
+_wait_for_sheep_recovery 0
+wait # collie
+$COLLIE vdi check test
+$COLLIE cluster info | _filter_cluster_info
diff --git a/tests/056.out b/tests/056.out
new file mode 100644
index 0000000..389e6f4
--- /dev/null
+++ b/tests/056.out
@@ -0,0 +1,19 @@
+QA output created by 056
+using backend farm store
+finish check&repair test
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time           Version
+DATE      2 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+finish check&repair test
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time           Version
+DATE      3 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7003]
+DATE      2 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
diff --git a/tests/group b/tests/group
index 0dda9b8..e70011a 100644
--- a/tests/group
+++ b/tests/group
@@ -69,3 +69,4 @@
 053 auto quick cluster md
 054 auto quick cluster md
 055 md
+056 md
-- 
1.7.9.5




More information about the sheepdog mailing list