[sheepdog] [PATCH v2 2/2] sheep: add test case for recovery from failed cluster

Robin Dong robin.k.dong at gmail.com
Fri Apr 25 09:00:26 CEST 2014


From: Robin Dong <sanbai at taobao.com>

Cc: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
Signed-off-by: Robin Dong <sanbai at taobao.com>
---
 tests/functional/091     | 38 ++++++++++++++++++++++++++++++++++++++
 tests/functional/091.out |  6 ++++++
 tests/functional/group   |  1 +
 3 files changed, 45 insertions(+)
 create mode 100755 tests/functional/091
 create mode 100644 tests/functional/091.out

diff --git a/tests/functional/091 b/tests/functional/091
new file mode 100755
index 0000000..ddfecb0
--- /dev/null
+++ b/tests/functional/091
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Test sheep recovery when restart whole cluster after some nodes be killed
+
+. ./common
+
+for i in `seq 0 15`; do _start_sheep $i; done
+_wait_for_sheep 16
+
+_cluster_format -c 8:4
+
+$DOG vdi create test 100M
+
+# write data
+_random | dd iflag=fullblock bs=1M count=100 2> /dev/null | $DOG vdi write test 0
+
+$DOG vdi read test | md5sum > $STORE/ck.1
+
+_vdi_list
+
+# kill 4 nodes
+for i in 9 5 3 2; do
+    _kill_sheep $i
+    _wait_for_sheep_recovery 1
+done
+
+# shutdown whole cluster and restart
+$DOG cluster shutdown
+
+for i in `seq 0 15`; do _start_sheep $i; done
+_wait_for_sheep 16
+
+# read data
+$DOG vdi read test -p 7001 | md5sum > $STORE/ck.2
+
+diff -u $STORE/ck.1 $STORE/ck.2
+
+_vdi_list
diff --git a/tests/functional/091.out b/tests/functional/091.out
new file mode 100644
index 0000000..d548965
--- /dev/null
+++ b/tests/functional/091.out
@@ -0,0 +1,6 @@
+QA output created by 091
+using backend plain store
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0  100 MB  100 MB  0.0 MB DATE   7c2b25    8:4              
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0  100 MB  100 MB  0.0 MB DATE   7c2b25    8:4              
diff --git a/tests/functional/group b/tests/functional/group
index 36c2cf4..7e747c3 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -105,3 +105,4 @@
 088 auto quick cluster
 089 auto quick sheepfs
 090 auto quick vdi md
+091 auto quick cluster md
-- 
1.7.12.4




More information about the sheepdog mailing list