[sheepdog] [PATCH v1 2/2] test: add test-case for nog-aligned read() on http interface of sheepfs

Robin Dong robin.k.dong at gmail.com
Fri Mar 21 06:13:59 CET 2014


From: Robin Dong <sanbai at taobao.com>

---
 tests/functional/089 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/functional/089 b/tests/functional/089
index f114668..9ea7354 100755
--- a/tests/functional/089
+++ b/tests/functional/089
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# Test http interface of sheepfs
+# Test http interface of sheepfs for cache
 
 . ./common
 
@@ -56,6 +56,14 @@ for i in 4 19 97 137; do
 done
 wait
 
+# read with recored-size of 10K to step over two caches should return 10K
+offset=`echo "64 * 1024 / 10"|bc`
+for i in 97 137; do
+	dd if=$STORE/sheepfs/http/sd/sheep/data$i skip=$offset bs=10K count=1 2> /dev/null | md5sum > $STORE/data$i.5
+	dd if=$STORE/data$i skip=$offset bs=10K count=1 2> /dev/null | md5sum > $STORE/data$i.6
+	diff -u $STORE/data$i.5 $STORE/data$i.6
+done
+
 # read objects with 'dd'
 for i in 4 19 97 137; do
 	dd if=$STORE/sheepfs/http/sd/sheep/data$i bs=1345679 2> /dev/null | md5sum > $STORE/data$i.3 &
-- 
1.7.12.4




More information about the sheepdog mailing list