]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
compression: add case to download range from big object 209/head
authorfang yuxiang <fang.yuxiang@eisoo.com>
Wed, 7 Feb 2018 08:16:39 +0000 (16:16 +0800)
committerfang yuxiang <fang.yuxiang@eisoo.com>
Wed, 7 Feb 2018 08:16:39 +0000 (16:16 +0800)
Signed-off-by: fang yuxiang <fang.yuxiang@eisoo.com>
s3tests/functional/test_s3.py

index 12b065a6d6984689b4d30f48ef759b96681cb4ea..6e54549f45355889b58d9fe9daf0cc0ae73797d2 100644 (file)
@@ -6397,6 +6397,29 @@ def test_ranged_request_response_code():
     eq(status, 206)
     eq(content_range, 'bytes 4-7/11')
 
+@attr(resource='object')
+@attr(method='get')
+@attr(operation='range')
+@attr(assertion='returns correct data, 206')
+def test_ranged_big_request_response_code():
+
+    bucket = get_new_bucket()
+    key = bucket.new_key('testobj')
+    string = os.urandom(8 * 1024 * 1024)
+    key.set_contents_from_string(string)
+
+    key.open('r', headers={'Range': 'bytes=3145728-5242880'})
+    status = key.resp.status
+    content_range = key.resp.getheader('Content-Range')
+    fetched_content = ''
+    for data in key:
+        fetched_content += data;
+    key.close()
+
+    eq(fetched_content, string[3145728:5242881])
+    eq(status, 206)
+    eq(content_range, 'bytes 3145728-5242880/8388608')
+
 @attr(resource='object')
 @attr(method='get')
 @attr(operation='range')