[sheepdog] [PATCH 1/5] tests: add a test case for object cache

Liu Yuan namei.unix at gmail.com
Tue Dec 4 13:20:27 CET 2012


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

Current master will fail this case due to work queue isn't initialized properly.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 tests/049     |   38 ++++++++++++++++++++++++++++++++++++++
 tests/049.out |    2 ++
 tests/group   |    1 +
 3 files changed, 41 insertions(+)
 create mode 100755 tests/049
 create mode 100644 tests/049.out

diff --git a/tests/049 b/tests/049
new file mode 100755
index 0000000..9174d31
--- /dev/null
+++ b/tests/049
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Test object cache reclaim at startup
+
+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 2`; do
+    _start_sheep $i "-w object:size=30"
+done
+
+_wait_for_sheep 3
+
+$COLLIE cluster format -c 1
+sleep 1
+
+$COLLIE vdi create test 20M
+dd if=/dev/urandom | $COLLIE vdi write -w test
+
+$COLLIE cluster shutdown
+sleep 1
+
+#trigger an object reclaim at startup
+for i in `seq 0 2`; do
+    _start_sheep $i "-w object:size=10"
+done
+
+_wait_for_sheep 3
diff --git a/tests/049.out b/tests/049.out
new file mode 100644
index 0000000..cd0e6ec
--- /dev/null
+++ b/tests/049.out
@@ -0,0 +1,2 @@
+QA output created by 049
+using backend farm store
diff --git a/tests/group b/tests/group
index 70389bf..a5b61b6 100644
--- a/tests/group
+++ b/tests/group
@@ -61,3 +61,4 @@
 046 auto quick vdi
 047 auto quick vdi
 048 auto quick collie
+049 auto quick cache
-- 
1.7.9.5




More information about the sheepdog mailing list