[sheepdog] [PATCH 2/2] test: add test case for RANGE GET in swift interface

Robin Dong robin.k.dong at gmail.com
Thu Jan 16 10:03:47 CET 2014


From: Robin Dong <sanbai at taobao.com>

Signed-off-by: Robin Dong <sanbai at taobao.com>
---
 tests/functional/081 | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/functional/081 b/tests/functional/081
index 11e1af6..8f38187 100755
--- a/tests/functional/081
+++ b/tests/functional/081
@@ -79,9 +79,27 @@ for i in 4 19 97 137; do
 	diff -u $STORE/data$i.1 $STORE/data$i.2
 done
 
+# get object range and check
+for i in 4 19 97 137; do
+	j=`expr $i \* $i`
+	curl -s --header "Range: bytes=${i}-${j}" -X GET http://localhost/v1/sd/sheep/data$i > $STORE/data$i.3 &
+done
+wait
+
+for i in 4 19 97 137; do
+	j=`expr $i \* $i`
+	cnt=`expr $j - $i + 1`
+	dd if=$STORE/data$i bs=1 skip=$i count=$cnt of=$STORE/data$i.4 2> /dev/null &
+done
+wait
+
+for i in 4 19 97 137; do
+	diff -u $STORE/data$i.3 $STORE/data$i.4
+done
+
 _vdi_list
 
-#delete the objects
+# delete the objects
 for file in $sheep_files; do
 	f=`basename $file`
 	curl -s -X DELETE http://localhost/v1/sd/sheep/$f &
-- 
1.7.12.4




More information about the sheepdog mailing list