ivandika3 commented on code in PR #10589:
URL: https://github.com/apache/ozone/pull/10589#discussion_r3460981875
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java:
##########
@@ -1294,4 +1294,29 @@ public void testGetMultipartUploadKeys() throws
Exception {
assertEquals(25, noPagination.size());
}
+
+ @Test
+ public void testListKeysSpecialKeyNames() throws Exception {
+ List<String> keyNames = Arrays.asList(" ", "\"",
+ "$", "%", "&", "'", "<", ">", "_", "_ ", "_ _", "__");
+
+ String volumeName = "volumeA";
+ String bucketName = "bucketA";
+ OMRequestTestUtils.addVolumeToDB(volumeName, omMetadataManager);
+ addBucketsToCache(volumeName, bucketName);
+
+ assertEquals("/volumeA/bucketA/ ",
+ omMetadataManager.getOzoneKey(volumeName, bucketName, " "));
+
+ for (int i = 0; i < keyNames.size(); i++) {
+ addKeysToOM(volumeName, bucketName, keyNames.get(i), i);
+ }
Review Comment:
I'd prefer if we actually have a S3 integration test to prove that Ozone
actually accepts a blank key (I'm not sure if it does). If not, then the S3
single white space S3 object key path will never be exercised.
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java:
##########
@@ -1294,4 +1294,29 @@ public void testGetMultipartUploadKeys() throws
Exception {
assertEquals(25, noPagination.size());
}
+
+ @Test
+ public void testListKeysSpecialKeyNames() throws Exception {
+ List<String> keyNames = Arrays.asList(" ", "\"",
+ "$", "%", "&", "'", "<", ">", "_", "_ ", "_ _", "__");
+
+ String volumeName = "volumeA";
+ String bucketName = "bucketA";
+ OMRequestTestUtils.addVolumeToDB(volumeName, omMetadataManager);
+ addBucketsToCache(volumeName, bucketName);
+
+ assertEquals("/volumeA/bucketA/ ",
+ omMetadataManager.getOzoneKey(volumeName, bucketName, " "));
+
+ for (int i = 0; i < keyNames.size(); i++) {
+ addKeysToOM(volumeName, bucketName, keyNames.get(i), i);
+ }
Review Comment:
I'd prefer if we actually have an S3 integration test to prove that Ozone
actually accepts a blank key (I'm not sure if it does). If not, then the S3
single white space S3 object key path will never be exercised.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]