sadanand48 commented on code in PR #6244:
URL: https://github.com/apache/ozone/pull/6244#discussion_r1497611121
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java:
##########
@@ -1984,6 +1986,48 @@ public void testLinkedAndNonLinkedBucketMetaData()
out.reset();
}
+ @Test
+ public void testKeyDeleteLegacyWithEnableFileSystemPath() throws IOException
{
+ String volumeName = "vol5";
+ String bucketName = "legacybucket";
+ String[] args = new String[] {"volume", "create", "o3://" + omServiceId +
OZONE_URI_DELIMITER + volumeName};
+ execute(ozoneShell, args);
+
+ args = new String[] {"bucket", "create", "o3://" + omServiceId +
OZONE_URI_DELIMITER +
+ volumeName + OZONE_URI_DELIMITER + bucketName, "--layout",
BucketLayout.LEGACY.toString()};
+ execute(ozoneShell, args);
+
+ String dirPath = OZONE_URI_DELIMITER + volumeName + OZONE_URI_DELIMITER +
+ bucketName + OZONE_URI_DELIMITER + "dir/";
+ String keyPath = dirPath + "key1";
+
+ // Create key, it will generate two keys, one with dirPath other with
keyPath
+ args = new String[] {"key", "put", "o3://" + omServiceId + keyPath,
testFile.getPath()};
+ execute(ozoneShell, args);
+
+ // Enable fileSystem path for client config
+ String fileSystemEnable =
generateSetConfString(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS, "true");
+ // Delete dirPath key, it should fail
+ args = new String[] {fileSystemEnable, "key", "delete", dirPath};
+ execute(ozoneShell, args);
+
+ // Check number of keys
+ args = new String[] {"key", "list", "o3://" + omServiceId +
OZONE_URI_DELIMITER +
+ volumeName + OZONE_URI_DELIMITER + bucketName};
+ out.reset();
+ execute(ozoneShell, args);
Review Comment:
The above 3 lines are not needed as we are already checking key list size
below.
--
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]