[sheepdog] [PATCH 3/3] test: add a test case for different VDI redundancy level

levin li levin108 at gmail.com
Thu Aug 23 13:34:54 CEST 2012


From: levin li <xingke.lwp at taobao.com>


Signed-off-by: levin li <xingke.lwp at taobao.com>
---
 tests/029     |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/029.out |   33 +++++++++++++++++++++++++++++++++
 tests/group   |    1 +
 3 files changed, 86 insertions(+), 0 deletions(-)
 create mode 100755 tests/029
 create mode 100644 tests/029.out

diff --git a/tests/029 b/tests/029
new file mode 100755
index 0000000..3bec2ec
--- /dev/null
+++ b/tests/029
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+# Test sheep VDI redundancy level
+
+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 `seq 0 6`; do
+	_start_sheep $i;
+done
+
+_wait_for_sheep 7
+
+$COLLIE cluster format -c 3
+
+for i in `seq 2 4`; do
+	$COLLIE vdi create test$i 20M -c $i -P
+done
+
+$COLLIE vdi snapshot -s tag test2
+$COLLIE vdi clone -s 1 test2 clone -c 3
+
+
+for i in `seq 2 3`; do
+	_kill_sheep $i;
+done
+
+for i in `seq 7 8`; do
+	_start_sheep $i;
+done
+
+_wait_for_sheep_recovery 0
+
+$COLLIE vdi delete clone
+$COLLIE vdi delete -s 1 test2
+
+$COLLIE vdi list | _filter_short_date
+
+for i in `seq 2 4`; do
+	$COLLIE vdi object test$i -i 1;
+done
+
diff --git a/tests/029.out b/tests/029.out
new file mode 100644
index 0000000..57d224f
--- /dev/null
+++ b/tests/029.out
@@ -0,0 +1,33 @@
+QA output created by 029
+using backend farm store
+  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test4        1   20 MB   20 MB  0.0 MB DATE   fd2de3     4              
+  test3        1   20 MB   20 MB  0.0 MB DATE   fd3662     3              
+  test2        2   20 MB  0.0 MB   20 MB DATE   fd3816     2              
+Looking for the object 0xfd381500000001 (the inode vid 0xfd3816 idx 1) with 7 nodes
+
+127.0.0.1:7000 doesn't have the object
+127.0.0.1:7001 doesn't have the object
+127.0.0.1:7004 doesn't have the object
+127.0.0.1:7005 has the object (should be 2 copies)
+127.0.0.1:7006 has the object (should be 2 copies)
+127.0.0.1:7007 doesn't have the object
+127.0.0.1:7008 doesn't have the object
+Looking for the object 0xfd366200000001 (the inode vid 0xfd3662 idx 1) with 7 nodes
+
+127.0.0.1:7000 doesn't have the object
+127.0.0.1:7001 doesn't have the object
+127.0.0.1:7004 has the object (should be 3 copies)
+127.0.0.1:7005 has the object (should be 3 copies)
+127.0.0.1:7006 doesn't have the object
+127.0.0.1:7007 doesn't have the object
+127.0.0.1:7008 has the object (should be 3 copies)
+Looking for the object 0xfd2de300000001 (the inode vid 0xfd2de3 idx 1) with 7 nodes
+
+127.0.0.1:7000 has the object (should be 4 copies)
+127.0.0.1:7001 has the object (should be 4 copies)
+127.0.0.1:7004 has the object (should be 4 copies)
+127.0.0.1:7005 doesn't have the object
+127.0.0.1:7006 doesn't have the object
+127.0.0.1:7007 has the object (should be 4 copies)
+127.0.0.1:7008 doesn't have the object
diff --git a/tests/group b/tests/group
index 28710b5..6a790b0 100644
--- a/tests/group
+++ b/tests/group
@@ -40,3 +40,4 @@
 026 auto quick vdi
 027 auto quick store
 028 auto quick store
+029 auto quick vdi
-- 
1.7.1




More information about the sheepdog mailing list