mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-23 23:30:38 +00:00
check for either 400 or 416 response code for invalid range test
Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
(cherry picked from commit e208a74a05
)
This commit is contained in:
parent
55e1c95b2f
commit
e4e6a3db12
1 changed files with 16 additions and 0 deletions
|
@ -5344,6 +5344,22 @@ def test_multipart_copy_small():
|
||||||
eq(key2.size, size)
|
eq(key2.size, size)
|
||||||
_check_key_content(src_key, key2)
|
_check_key_content(src_key, key2)
|
||||||
|
|
||||||
|
@attr(resource='object')
|
||||||
|
@attr(method='put')
|
||||||
|
@attr(operation='check multipart copies with an invalid range')
|
||||||
|
def test_multipart_copy_invalid_range():
|
||||||
|
bucket, key = _create_key_with_random_content('source', size=5)
|
||||||
|
upload = bucket.initiate_multipart_upload('dest')
|
||||||
|
e = assert_raises(boto.exception.S3ResponseError, copy_part, bucket.name, key.name, bucket, 'dest', upload.id, 0, 0, 21)
|
||||||
|
valid_status = [400, 416]
|
||||||
|
if not e.status in valid_status:
|
||||||
|
raise AssertionError("Invalid response " + str(status))
|
||||||
|
valid_reason = ['Bad Request', 'Requested Range Not Satisfiable']
|
||||||
|
if not e.reason in valid_reason:
|
||||||
|
raise AssertionError("Invalid reason " + e.reason )
|
||||||
|
# no standard error code defined
|
||||||
|
# eq(e.error_code, 'InvalidArgument')
|
||||||
|
|
||||||
@attr(resource='object')
|
@attr(resource='object')
|
||||||
@attr(method='put')
|
@attr(method='put')
|
||||||
@attr(operation='check multipart copies with single small part')
|
@attr(operation='check multipart copies with single small part')
|
||||||
|
|
Loading…
Reference in a new issue