[sheepdog] [PATCH 1/2] tests: add test to check wrong node joining

MORITA Kazutaka morita.kazutaka at gmail.com
Tue May 14 17:20:37 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

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

diff --git a/tests/060 b/tests/060
new file mode 100755
index 0000000..bf91857
--- /dev/null
+++ b/tests/060
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+# Test joining sheep with wrong but newer epoch
+
+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
+
+# start Sheepdog with 3 nodes
+$COLLIE cluster format
+sleep 1
+
+# kill sheep 0 so that sheep 2 has larger epoch
+_kill_sheep 0
+sleep 1
+
+$COLLIE cluster shutdown -p 7001
+_wait_for_sheep_stop
+
+# clean up sheep 0 and sheep 1
+rm -rf $STORE/0
+rm -rf $STORE/1
+
+for i in 0 1; do
+    _start_sheep $i
+done
+
+_wait_for_sheep 2
+
+# start Sheepdog with 2 nodes
+$COLLIE cluster format
+sleep 1
+
+$COLLIE cluster shutdown
+_wait_for_sheep_stop
+
+# sheep 2 should fail to join because it was formatted at the different time
+for i in 1 2 0; do
+    _start_sheep $i
+    sleep 1
+done
+
+# sheepdog should start with sheep 0 and sheep 1
+_wait_for_sheep_stop 2
+_wait_for_sheep 2
+
+for i in 0 1; do
+    $COLLIE cluster info -p 700$i | _filter_cluster_info
+done
diff --git a/tests/060.out b/tests/060.out
new file mode 100644
index 0000000..443b5dc
--- /dev/null
+++ b/tests/060.out
@@ -0,0 +1,15 @@
+QA output created by 060
+using backend farm store
+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]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time           Version
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001]
diff --git a/tests/group b/tests/group
index abef17e..3d7f785 100644
--- a/tests/group
+++ b/tests/group
@@ -73,3 +73,4 @@
 057 auto quick cluster md
 058 auto quick cluster md
 059 auto quick vdi md
+060 auto quick cluster md
-- 
1.7.9.5




More information about the sheepdog mailing list