From 13a9bfc00aab2bec910f5ac6b5f63fa24e5f48dd Mon Sep 17 00:00:00 2001 From: Mark Kogan Date: Tue, 7 Mar 2023 14:08:51 +0000 Subject: [PATCH] test object PUT with chunked transfer enconding Before the RGW fix PR was responding with 411 instead of 200 RGW fix PR: https://github.com/ceph/ceph/pull/50235 Signed-off-by: Mark Kogan --- s3tests_boto3/functional/test_s3.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/s3tests_boto3/functional/test_s3.py b/s3tests_boto3/functional/test_s3.py index 8e06844..027fb8f 100644 --- a/s3tests_boto3/functional/test_s3.py +++ b/s3tests_boto3/functional/test_s3.py @@ -1573,6 +1573,19 @@ def test_object_write_to_nonexist_bucket(): assert error_code == 'NoSuchBucket' +def _ev_add_te_header(request, **kwargs): + request.headers.add_header('Transfer-Encoding', 'chunked') + +def test_object_write_with_chunked_transfer_encoding(): + bucket_name = get_new_bucket() + client = get_client() + + client.meta.events.register_first('before-sign.*.*', _ev_add_te_header) + response = client.put_object(Bucket=bucket_name, Key='foo', Body='bar') + + assert response['ResponseMetadata']['HTTPStatusCode'] == 200 + + def test_bucket_create_delete(): bucket_name = get_new_bucket() client = get_client()