adoroszlai commented on code in PR #9297:
URL: https://github.com/apache/ozone/pull/9297#discussion_r2596621896


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMHALeaderSpecificACLEnforcement.java:
##########
@@ -373,6 +375,287 @@ public void 
testKeySetTimesAclEnforcementAfterLeadershipChange() throws Exceptio
     }
   }
 
+  /**
+   * Tests that setQuota ACL check is enforced in preExecute and is 
leader-specific.
+   */
+  @Test
+  public void testVolumeSetQuotaAclEnforcementAfterLeadershipChange() throws 
Exception {
+    ObjectStore adminObjectStore = client.getObjectStore();
+    String testVolume = "quotavol-" +
+        RandomStringUtils.secure().nextAlphabetic(5).toLowerCase(Locale.ROOT);
+
+    // Create volume as admin
+    VolumeArgs volumeArgs = VolumeArgs.newBuilder()
+        .setOwner(adminUserUgi.getShortUserName())
+        .build();
+    adminObjectStore.createVolume(testVolume, volumeArgs);
+
+    // Add test user as admin on current leader
+    OzoneManager currentLeader = cluster.getOMLeader();
+    addAdminToSpecificOM(currentLeader, TEST_USER);
+    assertTrue(currentLeader.getOmAdminUsernames().contains(TEST_USER));

Review Comment:
   nit: please use `assertThat(...).contains(...)` for better assertion failure 
message.  Similarly, `doesNotContain(...)` instead of `assertFalse(...)`.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/OMVolumeDeleteRequest.java:
##########
@@ -57,6 +60,36 @@ public OMVolumeDeleteRequest(OMRequest omRequest) {
     super(omRequest);
   }
 
+  @Override
+  public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
+    super.preExecute(ozoneManager);
+    DeleteVolumeRequest deleteVolumeRequest =
+        getOmRequest().getDeleteVolumeRequest();
+    Preconditions.checkNotNull(deleteVolumeRequest);

Review Comment:
   nit: prefer JDK's `Objects.requireNonNull`
   
   ```suggestion
       Objects.requireNonNull(deleteVolumeRequest);
   ```



-- 
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]

Reply via email to