HyunWooZZ commented on PR #46416: URL: https://github.com/apache/arrow/pull/46416#issuecomment-2875077238
> The testbench performs far fewer error checks, and no permission checks (ACL/IAM). [testbench_storage_github](https://github.com/googleapis/storage-testbench?tab=readme-ov-file#what-is-this-testbench) It seems the testbench skips permission checks. Do you have any thoughts on how to test that? I will add some test code like this. ```cpp TEST_F(GcsIntegrationTest, GetFileInfo) { ASSERT_OK_AND_ASSIGN(auto fs, GcsFileSystem::Make(TestGcsOptions())); constexpr auto kTextFileName = "dir/foo/bar.txt"; ASSERT_OK_AND_ASSIGN( auto output, fs->OpenOutputStream(PreexistingBucketPath() + kTextFileName, /*metadata=*/{})); const auto data = std::string(kLoremIpsum); ASSERT_OK(output->Write(data.data(), data.size())); ASSERT_OK(output->Close()); // check this is the File. AssertFileInfo(fs.get(), PreexistingBucketPath() + kTextFileName, FileType::File); // check parent directories are recognized as directories. AssertFileInfo(fs.get(), PreexistingBucketPath() + "dir/", FileType::Directory); AssertFileInfo(fs.get(), PreexistingBucketPath() + "dir/foo/", FileType::Directory); } TEST_F(GcsIntegrationTest, GetFileInfo_WithoutPermission) { TimePoint expiration = std::chrono::system_clock::now() + std::chrono::minutes(5); auto options = GcsOptions::FromAccessToken(/*access_token=*/"invalid-access-token", expiration); options.endpoint_override = "127.0.0.1:" + Testbench()->port(); ASSERT_OK_AND_ASSIGN(auto fs, GcsFileSystem::Make(options)); constexpr auto kTextFileName = "dir/foo/bar.txt"; // check this is the File without permission. AssertFileInfo(fs.get(), PreexistingBucketPath() + kTextFileName, FileType::NotFound); // check this is the directory without permission. AssertFileInfo(fs.get(), PreexistingBucketPath() + "dir/", FileType::NotFound); AssertFileInfo(fs.get(), PreexistingBucketPath() + "dir/foo/", FileType::NotFound); } ``` -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org