jojochuang commented on a change in pull request #1571:
URL: https://github.com/apache/ozone/pull/1571#discussion_r521568524



##########
File path: 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java
##########
@@ -318,6 +326,42 @@ public void testKeyOps() throws IOException {
 
   }
 
+  @Test
+  public void testAclOperations() throws IOException {
+    try {
+      // Create a volume.
+      cluster.getClient().getObjectStore().createVolume("volumeacl");
+
+      OzoneObj volObj = new OzoneObjInfo.Builder().setVolumeName("volumeacl")
+          .setResType(VOLUME).setStoreType(OZONE).build();
+
+      // Test getAcl
+      List<OzoneAcl> acls = ozoneManager.getAcl(volObj);
+      MetricsRecordBuilder omMetrics = getMetrics("OMMetrics");
+      assertCounter("NumGetAcl", 1L, omMetrics);
+
+      // Test addAcl
+      ozoneManager.addAcl(volObj,
+          new OzoneAcl(IAccessAuthorizer.ACLIdentityType.USER, "ozoneuser",
+              IAccessAuthorizer.ACLType.ALL, ACCESS));
+      omMetrics = getMetrics("OMMetrics");
+      assertCounter("NumAddAcl", 1L, omMetrics);
+
+      // Test setAcl
+      ozoneManager.setAcl(volObj, acls);
+      omMetrics = getMetrics("OMMetrics");
+      assertCounter("NumSetAcl", 1L, omMetrics);
+
+      // Test removeAcl
+      ozoneManager.removeAcl(volObj, acls.get(0));
+      omMetrics = getMetrics("OMMetrics");

Review comment:
       I wonder if it is really necessary to call this again and again. Doesn't 
look needed.




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

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