HDFS-13619. TestAuditLoggerWithCommands fails on Windows. Contributed by Anbang Hu.
This commit is contained in:
parent
8733012ae3
commit
13d2528907
@ -1264,8 +1264,9 @@ private void verifySafeModeAction(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int verifyAuditLogs(String pattern) {
|
private int verifyAuditLogs(String pattern) {
|
||||||
int length = auditlog.getOutput().split("\n").length;
|
int length = auditlog.getOutput().split(System.lineSeparator()).length;
|
||||||
String lastAudit = auditlog.getOutput().split("\n")[length - 1];
|
String lastAudit = auditlog.getOutput()
|
||||||
|
.split(System.lineSeparator())[length - 1];
|
||||||
assertTrue("Unexpected log!", lastAudit.matches(pattern));
|
assertTrue("Unexpected log!", lastAudit.matches(pattern));
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user