[sheepdog] [PATCH 3/6] tests: add check for force cluster recovery

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Feb 26 05:06:47 CET 2013


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 tests/052     |  54 +++++++++++++++++++++++
 tests/052.out | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/group   |   1 +
 3 files changed, 193 insertions(+)
 create mode 100755 tests/052
 create mode 100644 tests/052.out

diff --git a/tests/052 b/tests/052
new file mode 100755
index 0000000..7d4b4f2
--- /dev/null
+++ b/tests/052
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+# Test force cluster recovery with new nodes
+
+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 3; do
+    _start_sheep $i
+done
+_wait_for_sheep 4
+$COLLIE cluster format
+sleep 1
+$COLLIE vdi create test 20M -P
+$COLLIE cluster info | _filter_cluster_info
+
+$COLLIE cluster shutdown
+sleep 1
+
+for i in 0 1 2 4; do
+    _start_sheep $i
+done
+_wait_for_sheep 4
+for i in 0 1 2 4; do
+    $COLLIE cluster info -p 700$i | _filter_cluster_info
+    $COLLIE vdi list | _filter_short_date
+done
+
+echo yes | $COLLIE cluster recover force
+echo ""
+
+$COLLIE vdi check test
+
+for i in 0 1 2 4; do
+    $COLLIE cluster info -p 700$i | _filter_cluster_info
+    $COLLIE vdi list | _filter_short_date
+done
+
+_start_sheep 3
+_wait_for_sheep 5
+for i in 0 1 2 3 4; do
+    $COLLIE cluster info -p 700$i | _filter_cluster_info
+    $COLLIE vdi list | _filter_short_date
+done
diff --git a/tests/052.out b/tests/052.out
new file mode 100644
index 0000000..23ad723
--- /dev/null
+++ b/tests/052.out
@@ -0,0 +1,138 @@
+QA output created by 052
+using backend farm store
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time           Version
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+Cluster status: Waiting for other nodes to join cluster
+
+Cluster created at DATE
+
+Epoch Time           Version
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+Failed to read object 807c2b2500000000 Waiting for other nodes to join cluster
+Failed to read inode header
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+Cluster status: Waiting for other nodes to join cluster
+
+Cluster created at DATE
+
+Epoch Time           Version
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+Failed to read object 807c2b2500000000 Waiting for other nodes to join cluster
+Failed to read inode header
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+Cluster status: Waiting for other nodes to join cluster
+
+Cluster created at DATE
+
+Epoch Time           Version
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+Failed to read object 807c2b2500000000 Waiting for other nodes to join cluster
+Failed to read inode header
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+Cluster status: Waiting for other nodes to join cluster
+Failed to read object 807c2b2500000000 Waiting for other nodes to join cluster
+Failed to read inode header
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+Caution! Please try starting all the cluster nodes normally before
+running this command.
+
+The cluster may need to be force recovered if:
+  - the master node fails to start because of epoch mismatch; or
+  - some nodes fail to start after a cluster shutdown.
+
+Are you sure you want to continue? [yes/no]: 
+fixed missing 7c2b2500000001
+fixed missing 7c2b2500000002
+fixed missing 7c2b2500000003
+fixed missing 7c2b2500000004
+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:7004]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         1   20 MB   20 MB  0.0 MB DATE   7c2b25     3              
+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:7004]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         1   20 MB   20 MB  0.0 MB DATE   7c2b25     3              
+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:7004]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         1   20 MB   20 MB  0.0 MB DATE   7c2b25     3              
+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:7004]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         1   20 MB   20 MB  0.0 MB DATE   7c2b25     3              
+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:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE      2 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7004]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         1   20 MB   20 MB  0.0 MB DATE   7c2b25     3              
+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:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE      2 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7004]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         1   20 MB   20 MB  0.0 MB DATE   7c2b25     3              
+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:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE      2 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7004]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         1   20 MB   20 MB  0.0 MB DATE   7c2b25     3              
+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:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE      2 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7004]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         1   20 MB   20 MB  0.0 MB DATE   7c2b25     3              
+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:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE      2 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7004]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003]
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         1   20 MB   20 MB  0.0 MB DATE   7c2b25     3              
diff --git a/tests/group b/tests/group
index f46134e..fd39ea4 100644
--- a/tests/group
+++ b/tests/group
@@ -64,3 +64,4 @@
 049 auto quick cache
 050 auto quick cluster
 051 auto quick cluster
+052 auto quick cluster
-- 
1.8.1.3.566.gaa39828




More information about the sheepdog mailing list