Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s3: test checksumming with streaming uploads #540

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cbodley
Copy link
Contributor

@cbodley cbodley commented Jan 31, 2024

client.put_object() doesn't seem to support STREAMING payloads, but client.upload_fileobj() can

against http endpoint:

2024-01-31T11:06:33.649-0500 7f038d3bb6c0 20 HTTP_X_AMZ_CHECKSUM_CRC32=Ms4xMg==
2024-01-31T11:06:33.649-0500 7f038d3bb6c0 20 HTTP_X_AMZ_CONTENT_SHA256=cdbec94cbcdbdfc1e8202c189dcec8d72d21157a02bba3a03f0b702ed5b3fe56
2024-01-31T11:06:33.649-0500 7f038d3bb6c0 20 HTTP_X_AMZ_DATE=20240131T160633Z
2024-01-31T11:06:33.649-0500 7f038d3bb6c0 20 HTTP_X_AMZ_SDK_CHECKSUM_ALGORITHM=CRC32

against https endpoint:

2024-01-31T11:10:04.721-0500 7fb0fa7ac6c0 20 HTTP_X_AMZ_CONTENT_SHA256=STREAMING-UNSIGNED-PAYLOAD-TRAILER
2024-01-31T11:10:04.721-0500 7fb0fa7ac6c0 20 HTTP_X_AMZ_DATE=20240131T161004Z
2024-01-31T11:10:04.721-0500 7fb0fa7ac6c0 20 HTTP_X_AMZ_DECODED_CONTENT_LENGTH=7340032
2024-01-31T11:10:04.721-0500 7fb0fa7ac6c0 20 HTTP_X_AMZ_SDK_CHECKSUM_ALGORITHM=CRC32
2024-01-31T11:10:04.721-0500 7fb0fa7ac6c0 20 HTTP_X_AMZ_TRAILER=x-amz-checksum-crc32

Comment on lines 13104 to 13506
# test streaming uploads with sizes below and above the 8MB multipart threshold
upload_sizes = [7 * 1024 * 1024, 9 * 1024 * 1024]

@pytest.mark.checksum
@pytest.mark.parametrize("size", upload_sizes)
def test_streaming_upload_checksum_crc32(size):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the original 7MB size was below the default multipart threshold of 8MB, so wasn't testing multipart uploads. i parameterized these tests for sizes 7MB and 9MB to cover both

@cbodley cbodley force-pushed the wip-streaming-checksum branch 3 times, most recently from 8c071c5 to 47f532c Compare February 14, 2024 00:49
@cbodley
Copy link
Contributor Author

cbodley commented Feb 14, 2024

these test cases are all passing against aws us-east-1

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant