[sheepdog] [PATCH v2 1/9] tests/functional: add test to check wrong node joining with newer epoch
MORITA Kazutaka
morita.kazutaka at gmail.com
Fri Jul 12 22:25:51 CEST 2013
From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
This test can be passed after I refined the sheepdog start-up
procedure, but it's still meaningful to have this test for detecting
degradation.
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
tests/functional/069 | 62 ++++++++++++++++++++++++++++++++++++++++++++++
tests/functional/069.out | 15 +++++++++++
tests/functional/group | 1 +
3 files changed, 78 insertions(+)
create mode 100755 tests/functional/069
create mode 100644 tests/functional/069.out
diff --git a/tests/functional/069 b/tests/functional/069
new file mode 100755
index 0000000..d453aca
--- /dev/null
+++ b/tests/functional/069
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+# Test joining sheep with wrong and 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
+_cluster_format
+
+# kill sheep 0 so that sheep 2 has larger epoch
+_kill_sheep 0
+_wait_for_sheep_stop 0
+
+$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
+_cluster_format
+
+$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/functional/069.out b/tests/functional/069.out
new file mode 100644
index 0000000..dba8f3f
--- /dev/null
+++ b/tests/functional/069.out
@@ -0,0 +1,15 @@
+QA output created by 069
+using backend plain store
+using backend plain store
+Cluster status: running, auto-recovery enabled
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster status: running, auto-recovery enabled
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
diff --git a/tests/functional/group b/tests/functional/group
index ab34281..362f777 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -82,3 +82,4 @@
066 auto quick cluster md
067 auto quick cluster
068 auto quick cluster
+069 auto quick cluster md
--
1.7.9.5
More information about the sheepdog
mailing list