[sheepdog] [PATCH] test: consolidate 009 and 028

Liu Yuan namei.unix at gmail.com
Wed Aug 22 09:10:05 CEST 2012


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

- use helper for wait recovery at 009
- check all the objects in 028

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 tests/009     |    3 +--
 tests/028     |    4 ++--
 tests/028.out |   12 ++++++++++++
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/tests/009 b/tests/009
index e0f2add..29c86be 100755
--- a/tests/009
+++ b/tests/009
@@ -33,8 +33,7 @@ cat /dev/urandom | $COLLIE vdi write test
 # restart the 3rd node
 _start_sheep 2
 
-# wait for object recovery to finish
-sleep 10
+_wait_for_sheep_recovery 0
 
 # show md5sum of the vdi on each node
 for i in 0 1 2; do
diff --git a/tests/028 b/tests/028
index a9584ed..026c6d1 100755
--- a/tests/028
+++ b/tests/028
@@ -48,11 +48,11 @@ $COLLIE vdi read test -p 7001 | md5sum > /tmp/csum.3
 
 $COLLIE vdi object test
 
-for i in `seq 0 1`; do
+for i in `seq 0 4`; do
     $COLLIE vdi object -i $i test
 done
 
-if [ "$diff -u /tmp/csum.0 /tmp/csum.1)" ]; then
+if [ "$(diff -u /tmp/csum.0 /tmp/csum.1)" ]; then
     echo "update test successfully"
 fi
 
diff --git a/tests/028.out b/tests/028.out
index c1278ba..db2f209 100644
--- a/tests/028.out
+++ b/tests/028.out
@@ -12,4 +12,16 @@ Looking for the object 0x7c2b2500000001 (the inode vid 0x7c2b25 idx 1) with 2 no
 
 127.0.0.1:7000 has the object (should be 2 copies)
 127.0.0.1:7001 has the object (should be 2 copies)
+Looking for the object 0x7c2b2500000002 (the inode vid 0x7c2b25 idx 2) with 2 nodes
+
+127.0.0.1:7000 has the object (should be 2 copies)
+127.0.0.1:7001 has the object (should be 2 copies)
+Looking for the object 0x7c2b2500000003 (the inode vid 0x7c2b25 idx 3) with 2 nodes
+
+127.0.0.1:7000 has the object (should be 2 copies)
+127.0.0.1:7001 has the object (should be 2 copies)
+Looking for the object 0x7c2b2500000004 (the inode vid 0x7c2b25 idx 4) with 2 nodes
+
+127.0.0.1:7000 has the object (should be 2 copies)
+127.0.0.1:7001 has the object (should be 2 copies)
 update test successfully
-- 
1.7.10.2




More information about the sheepdog mailing list