[sheepdog] [PATCH] test: consolidate 010 to check manual recovery

Liu Yuan namei.unix at gmail.com
Tue Aug 21 05:03:52 CEST 2012


From: Liu Yuan <tailai.ly at taobao.com>

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 tests/010     |   14 ++++++++++----
 tests/010.out |   15 ++++++++++++++-
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/tests/010 b/tests/010
index 7496e2d..c3f53b4 100755
--- a/tests/010
+++ b/tests/010
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+# Test manual recovery command
+
 seq=`basename $0`
 echo "QA output created by $seq"
 
@@ -13,15 +15,14 @@ status=1        # failure is the default!
 
 _cleanup
 
-_start_sheep 0
-_start_sheep 1
+for i in `seq 0 1`; do _start_sheep $i; done
 
-sleep 2
+_wait_for_sheep 2
 
 $COLLIE cluster format -c 2
 $COLLIE cluster recover disable
 
-qemu-img create sheepdog:test 4G
+$COLLIE vdi create test 4G
 
 # create 20 objects
 for i in `seq 0 19`; do
@@ -34,3 +35,8 @@ _start_sheep 2
 for i in `seq 0 19`; do
     $COLLIE vdi write test $((i * 4 * 1024 * 1024)) 512 < /dev/zero
 done
+
+$COLLIE cluster info | _filter_cluster_info
+
+$COLLIE cluster recover enable
+$COLLIE cluster info | _filter_cluster_info
diff --git a/tests/010.out b/tests/010.out
index 01cc1bf..ea84c35 100644
--- a/tests/010.out
+++ b/tests/010.out
@@ -2,4 +2,17 @@ QA output created by 010
 using backend farm store
 *Note*: Only disable the recovery caused by JOIN envets
 Cluster recovery: disable
-Formatting 'sheepdog:test', fmt=raw size=4294967296 
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time           Version
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster recovery: enable
+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]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001]
-- 
1.7.10.2




More information about the sheepdog mailing list