virajjasani commented on a change in pull request #3698:
URL: https://github.com/apache/hadoop/pull/3698#discussion_r754099463
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java
##########
@@ -599,6 +599,36 @@ public void testAuditLogWithRemotePort() throws Exception {
}
}
+ @Test
+ public void testCallerContextCharacterEscape() throws IOException {
+ Configuration conf = new HdfsConfiguration();
+ conf.setBoolean(HADOOP_CALLER_CONTEXT_ENABLED_KEY, true);
+ conf.setInt(HADOOP_CALLER_CONTEXT_MAX_SIZE_KEY, 128);
+ conf.setInt(HADOOP_CALLER_CONTEXT_SIGNATURE_MAX_SIZE_KEY, 40);
+ MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).build();
+ LogCapturer auditlog = LogCapturer.captureLogs(FSNamesystem.auditLog);
+
+ try {
+ cluster.waitClusterUp();
+ final FileSystem fs = cluster.getFileSystem();
+ final long time = System.currentTimeMillis();
+ final Path p = new Path("/");
Review comment:
nit: how about using try-with-resources here?
```
try (MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).build()) {
LogCapturer auditlog = LogCapturer.captureLogs(FSNamesystem.auditLog);
cluster.waitClusterUp();
...
...
...
}
```
--
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]