ayushtkn commented on a change in pull request #1571:
URL: https://github.com/apache/ozone/pull/1571#discussion_r521698851
##########
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:
Well, I also thought the same, it should be required only once, But my
test itself fails without that. If you observe the tests above.
`testVolumeOps`, `testBucketOps` and `testKeyOps` they too are also calling
``getMetrics("OMMetrics");`` before asserting.
The `getMetrics` seems to fetch the values and keep it. it doesn't seems to
be updating.
----------------------------------------------------------------
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]