ripplehang commented on code in PR #43601:
URL: https://github.com/apache/arrow/pull/43601#discussion_r1793491555
##########
cpp/src/arrow/filesystem/s3fs_test.cc:
##########
@@ -1295,6 +1314,36 @@ TEST_F(TestS3FS, OpenInputFile) {
ASSERT_RAISES(IOError, file->Seek(10));
}
+#ifdef MINIO_SERVER_WITH_TLS
+TEST_F(TestS3FS, SSECustomerKeyMatch) {
+ // normal write/read with correct SSEC key
+ std::shared_ptr<io::OutputStream> stream;
+ options_.sse_customer_key = "12345678123456781234567812345678";
+ MakeFileSystem();
+ ASSERT_OK_AND_ASSIGN(stream,
fs_->OpenOutputStream("bucket/newfile_with_sse_c"));
+ ASSERT_OK(stream->Write("some"));
+ ASSERT_OK(stream->Close());
+ ASSERT_OK_AND_ASSIGN(auto file,
fs_->OpenInputFile("bucket/newfile_with_sse_c"));
+ ASSERT_OK_AND_ASSIGN(auto buf, file->Read(4));
+ AssertBufferEqual(*buf, "some");
+ ASSERT_OK(RestoreTestBucket());
+}
+
+TEST_F(TestS3FS, SSECustomerKeyMismatch) {
+ std::shared_ptr<io::OutputStream> stream;
+ options_.sse_customer_key = "12345678123456781234567812345678";
+ MakeFileSystem();
+ ASSERT_OK_AND_ASSIGN(stream,
fs_->OpenOutputStream("bucket/newfile_with_sse_c"));
+ ASSERT_OK(stream->Write("some"));
+ ASSERT_OK(stream->Close());
+
+ options_.sse_customer_key = "87654321876543218765432187654321";
+ MakeFileSystem();
+ ASSERT_RAISES(IOError, fs_->OpenInputFile("bucket/newfile_with_sse_c"));
+ ASSERT_OK(RestoreTestBucket());
+}
Review Comment:
ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]