Gargi-jais11 commented on code in PR #10014:
URL: https://github.com/apache/ozone/pull/10014#discussion_r3019642222
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/bucket/TestOMBucketCreateRequest.java:
##########
@@ -68,15 +68,24 @@ public void testPreExecute() throws Exception {
}
@Test
- public void preExecuteRejectsInvalidBucketName() {
- // Verify invalid bucket name throws exception
+ public void preExecuteRejectsShortBucketNameWhenStrictS3Enabled() {
+ when(ozoneManager.isStrictS3()).thenReturn(true);
+
OMException omException = assertThrows(OMException.class,
() -> doPreExecute("volume1", "b1"));
assertEquals(
"bucket name 'b1' is too short, valid length is 3-63 characters",
omException.getMessage());
}
+ @Test
+ public void preExecuteAllowsShortBucketNameWhenStrictS3Disabled()
Review Comment:
Similarly, you can check if isS3strict=false then larger bucket name ( > 63)
is allowed.
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/bucket/TestOMBucketCreateRequest.java:
##########
@@ -68,15 +68,24 @@ public void testPreExecute() throws Exception {
}
@Test
- public void preExecuteRejectsInvalidBucketName() {
- // Verify invalid bucket name throws exception
+ public void preExecuteRejectsShortBucketNameWhenStrictS3Enabled() {
Review Comment:
Make this Parameterised and pass both bucket name less than 3 length and
bucket name greater than 63 length, then check suck bucket names should be
rejected.
--
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]