From: Robin Dong <[email protected]>

Cc: Liu Yuan <[email protected]>
Cc: MORITA Kazutaka <[email protected]>
Signed-off-by: Robin Dong <[email protected]>
Signed-off-by: Liu Yuan <[email protected]>

Conflicts:
        tests/functional/group
Conflicts were resolved by Hitoshi Mitake.
Signed-off-by: Hitoshi Mitake <[email protected]>
---
 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 13306d9..67307bf 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -101,3 +101,4 @@
 084 auto quick sheepfs
 085 auto quick vdi md
 086 auto quick vdi md
+091 auto quick cluster md
-- 
1.9.1

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to