Skip to content

Instantly share code, notes, and snippets.

@cbodley
Created March 9, 2023 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbodley/8ac10990a4c1c253b2cf627bcd313572 to your computer and use it in GitHub Desktop.
Save cbodley/8ac10990a4c1c253b2cf627bcd313572 to your computer and use it in GitHub Desktop.

when GetObj returns a fake ETag from md5sum /dev/null:

diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc
index ccb8a397aec..dbb8576ebbc 100644
--- a/src/rgw/rgw_rest_s3.cc
+++ b/src/rgw/rgw_rest_s3.cc
@@ -445,7 +445,7 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs,
     } else {
       auto iter = attrs.find(RGW_ATTR_ETAG);
       if (iter != attrs.end()) {
-        dump_etag(s, iter->second.to_str());
+        dump_etag(s, "d41d8cd98f00b204e9800998ecf8427e");

boto: the only test failures were the result of ETag comparisons between GetObject, ListObjects, and PutObject. these would pass if the ops were consistent about this fake-etag behavior

================================================================== short test summary info ===================================================================
FAILED s3tests/functional/test_s3.py::test_atomic_dual_conditional_write_1mb - AssertionError: assert 'AAAAAAAAAAAA...AAAAAAAAAAAAA' == 'BBBBBBBBBBBB...BBBBBBBBBBBBB'
FAILED s3tests_boto3/functional/test_s3.py::test_bucket_list_return_data - assert '"37b51d194a7...f6524f2d51f2"' == '"d41d8cd98f0...0998ecf8427e"'
FAILED s3tests_boto3/functional/test_s3.py::test_bucket_list_return_data_versioning - assert '"37b51d194a7...f6524f2d51f2"' == '"d41d8cd98f0...0998ecf8427e"'
FAILED s3tests_boto3/functional/test_s3.py::test_post_object_success_redirect_action - AssertionError: assert 'http://local...524f2d51f2%22' == 'http://local...98ecf8427e%22'
FAILED s3tests_boto3/functional/test_s3.py::test_put_object_ifmatch_good - botocore.exceptions.ClientError: An error occurred (PreconditionFailed) when calling the PutObject operation: Unknown
FAILED s3tests_boto3/functional/test_s3.py::test_put_object_ifnonmatch_failed - AssertionError: ClientError not raised
================================ 6 failed, 576 passed, 77 skipped, 112 deselected, 1 xfailed, 3 warnings in 287.36s (0:04:47) ================================
ERROR: InvocationError for command /home/cbodley/s3-tests/.tox/py/bin/pytest -m 'not fails_on_rgw and not sse_s3 and not lifecycle_expiration and not test_of_sts and not webidentity_test' (exited with code 1)

's3cmd get' does not try to verify the etag and succeeds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment