mirror of
https://github.com/ceph/s3-tests.git
synced 2024-12-23 13:41:52 +00:00
Test S3 api for handling of Content-MD5 that does not match.
The existing test_object_create_bad_md5_invalid is not valid base64, and hence triggers a different code path. This time, submit valid base64, but have the result not match the expected md5sum.
This commit is contained in:
parent
0e9935a01e
commit
199b8b46c5
1 changed files with 11 additions and 0 deletions
|
@ -159,6 +159,17 @@ def test_object_create_bad_md5_invalid():
|
||||||
eq(e.error_code, 'InvalidDigest')
|
eq(e.error_code, 'InvalidDigest')
|
||||||
|
|
||||||
|
|
||||||
|
@nose.with_setup(teardown=_clear_custom_headers)
|
||||||
|
@attr('fails_on_dho')
|
||||||
|
def test_object_create_bad_md5_wrong():
|
||||||
|
key = _setup_bad_object({'Content-MD5':'YWJyYWNhZGFicmE='})
|
||||||
|
|
||||||
|
e = assert_raises(boto.exception.S3ResponseError, key.set_contents_from_string, 'bar')
|
||||||
|
eq(e.status, 400)
|
||||||
|
eq(e.reason, 'Bad Request')
|
||||||
|
eq(e.error_code, 'InvalidDigest')
|
||||||
|
|
||||||
|
|
||||||
@nose.with_setup(teardown=_clear_custom_headers)
|
@nose.with_setup(teardown=_clear_custom_headers)
|
||||||
@attr('fails_on_dho')
|
@attr('fails_on_dho')
|
||||||
def test_object_create_bad_md5_empty():
|
def test_object_create_bad_md5_empty():
|
||||||
|
|
Loading…
Reference in a new issue