[sheepdog] [PATCH 2/2] tests/054:test automatic stale object purging

wangfan wangfan1985 at gmail.com
Sat Mar 16 08:04:56 CET 2013


test whether .stale directory has a object file.
if use -md option,it can also check.

Signed-off-by: wangfan <wangfan1985 at gmail.com>
---
 tests/054     |   35 +++++++++++++++++++++++++++++++++++
 tests/054.out |   16 ++++++++++++++++
 tests/group   |    1 +
 3 files changed, 52 insertions(+), 0 deletions(-)
 create mode 100755 tests/054
 create mode 100644 tests/054.out

diff --git a/tests/054 b/tests/054
new file mode 100755
index 0000000..0a71a7b
--- /dev/null
+++ b/tests/054
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# Test after recovery is completed.useless files have been deleted.
+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
+#start three in different size
+for i in 0 1 2; do
+	_start_sheep $i "-s $(($i+1))000"
+done
+_wait_for_sheep 3
+$COLLIE cluster format
+sleep 1
+$COLLIE vdi create test 100M -P
+$COLLIE cluster info | _filter_cluster_info
+
+#start recovery
+ _start_sheep 3 "-s 3000"
+sleep 1
+_wait_for_sheep 4
+_wait_for_sheep_recovery 0
+$COLLIE cluster info | _filter_cluster_info
+
+sleep 1
+#test no object in .stale
+ls $STORE/*/*/.stale | grep ^- | wc -l
diff --git a/tests/054.out b/tests/054.out
new file mode 100644
index 0000000..5174148
--- /dev/null
+++ b/tests/054.out
@@ -0,0 +1,16 @@
+QA output created by 054
+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, 127.0.0.1:7002]
+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, 127.0.0.1:7003]
+DATE      1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+0
diff --git a/tests/group b/tests/group
index 8d025ca..2cfb41e 100644
--- a/tests/group
+++ b/tests/group
@@ -67,3 +67,4 @@
 051 auto quick cluster md
 052 auto quick cluster md
 053 auto quick cluster md
+054 auto quick cluster md
-- 
1.7.1




More information about the sheepdog mailing list