s3: disable checksum calculation for test_object_create_bad_contentlength_negative

if tls is enabled, boto will switch to STREAMING-UNSIGNED-PAYLOAD-TRAILER
and omit the provided content-length header. this leads to test failure:

> ________________ test_object_create_bad_contentlength_negative _________________
>       e = assert_raises(ClientError, client.put_object, Bucket=bucket_name, Key=key_name, ContentLength=-1)
> AssertionError: ClientError not raised

Signed-off-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2025-02-14 11:35:54 -05:00
parent 41b7297e7a
commit a40c28fcc3

View file

@ -1,5 +1,6 @@
import boto3
import pytest
import botocore.config
from botocore.exceptions import ClientError
from email.utils import formatdate
@ -209,7 +210,10 @@ def test_object_create_bad_contentlength_empty():
@pytest.mark.auth_common
@pytest.mark.fails_on_mod_proxy_fcgi
def test_object_create_bad_contentlength_negative():
client = get_client()
# to test Content-Length=-1, we have to prevent the checksum calculation
# from switching to STREAMING-UNSIGNED-PAYLOAD-TRAILER
config = botocore.config.Config(request_checksum_calculation = 'when_required')
client = get_client(config)
bucket_name = get_new_bucket()
key_name = 'foo'
e = assert_raises(ClientError, client.put_object, Bucket=bucket_name, Key=key_name, ContentLength=-1)