mirror of
https://github.com/ceph/s3-tests.git
synced 2024-12-23 13:41:52 +00:00
Test Content-Range header in range requests
Signed-off-by: Andrew Gaul <andrew@gaul.org>
This commit is contained in:
parent
6e70b4b511
commit
f6329714cc
1 changed files with 6 additions and 0 deletions
|
@ -5344,6 +5344,7 @@ def test_ranged_request_response_code():
|
|||
|
||||
key.open('r', headers={'Range': 'bytes=4-7'})
|
||||
status = key.resp.status
|
||||
content_range = key.resp.getheader('Content-Range')
|
||||
fetched_content = ''
|
||||
for data in key:
|
||||
fetched_content += data;
|
||||
|
@ -5351,6 +5352,7 @@ def test_ranged_request_response_code():
|
|||
|
||||
eq(fetched_content, content[4:8])
|
||||
eq(status, 206)
|
||||
eq(content_range, 'bytes 4-7/11')
|
||||
|
||||
@attr(resource='object')
|
||||
@attr(method='get')
|
||||
|
@ -5366,6 +5368,7 @@ def test_ranged_request_skip_leading_bytes_response_code():
|
|||
# test trailing bytes
|
||||
key.open('r', headers={'Range': 'bytes=4-'})
|
||||
status = key.resp.status
|
||||
content_range = key.resp.getheader('Content-Range')
|
||||
fetched_content = ''
|
||||
for data in key:
|
||||
fetched_content += data;
|
||||
|
@ -5373,6 +5376,7 @@ def test_ranged_request_skip_leading_bytes_response_code():
|
|||
|
||||
eq(fetched_content, content[4:])
|
||||
eq(status, 206)
|
||||
eq(content_range, 'bytes 4-10/11')
|
||||
|
||||
@attr(resource='object')
|
||||
@attr(method='get')
|
||||
|
@ -5388,6 +5392,7 @@ def test_ranged_request_return_trailing_bytes_response_code():
|
|||
# test leading bytes
|
||||
key.open('r', headers={'Range': 'bytes=-7'})
|
||||
status = key.resp.status
|
||||
content_range = key.resp.getheader('Content-Range')
|
||||
fetched_content = ''
|
||||
for data in key:
|
||||
fetched_content += data;
|
||||
|
@ -5395,6 +5400,7 @@ def test_ranged_request_return_trailing_bytes_response_code():
|
|||
|
||||
eq(fetched_content, content[-7:])
|
||||
eq(status, 206)
|
||||
eq(content_range, 'bytes 4-10/11')
|
||||
|
||||
def check_can_test_multiregion():
|
||||
if not targets.main.master or len(targets.main.secondaries) == 0:
|
||||
|
|
Loading…
Reference in a new issue