You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cn...@apache.org on 2015/11/03 21:02:53 UTC
[1/2] hadoop git commit: HDFS-9362.
TestAuditLogger#testAuditLoggerWithCallContext assumes Unix line endings,
fails on Windows. Contributed by Chris Nauroth.
Repository: hadoop
Updated Branches:
refs/heads/branch-2 9d11d2a8f -> 246ab44b5
refs/heads/trunk 095ac8340 -> 7e2829662
HDFS-9362. TestAuditLogger#testAuditLoggerWithCallContext assumes Unix line endings, fails on Windows. Contributed by Chris Nauroth.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7e282966
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7e282966
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7e282966
Branch: refs/heads/trunk
Commit: 7e2829662b4c4bf33ebaf2fa09312d0bed3d6f92
Parents: 095ac83
Author: cnauroth <cn...@apache.org>
Authored: Tue Nov 3 11:54:57 2015 -0800
Committer: cnauroth <cn...@apache.org>
Committed: Tue Nov 3 11:54:57 2015 -0800
----------------------------------------------------------------------
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++
.../hdfs/server/namenode/TestAuditLogger.java | 24 ++++++++++++--------
2 files changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/7e282966/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 1729b73..fbf211f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -2222,6 +2222,9 @@ Release 2.8.0 - UNRELEASED
HDFS-9354. Fix TestBalancer#testBalancerWithZeroThreadsForMove on Windows.
(Xiaoyu Yao via cnauroth)
+ HDFS-9362. TestAuditLogger#testAuditLoggerWithCallContext assumes Unix line
+ endings, fails on Windows. (cnauroth)
+
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES
http://git-wip-us.apache.org/repos/asf/hadoop/blob/7e282966/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java
index 252f7af..d637abc 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java
@@ -243,7 +243,8 @@ public class TestAuditLogger {
CallerContext.setCurrent(context);
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.setTimes(p, time, time);
- assertTrue(auditlog.getOutput().endsWith("callerContext=setTimes\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=setTimes%n")));
auditlog.clearOutput();
// context with signature
@@ -254,7 +255,7 @@ public class TestAuditLogger {
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.setTimes(p, time, time);
assertTrue(auditlog.getOutput().endsWith(
- "callerContext=setTimes:L\n"));
+ String.format("callerContext=setTimes:L%n")));
auditlog.clearOutput();
// long context is truncated
@@ -266,7 +267,7 @@ public class TestAuditLogger {
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.setTimes(p, time, time);
assertTrue(auditlog.getOutput().endsWith(
- "callerContext=" + longContext.substring(0, 128) + ":L\n"));
+ String.format("callerContext=%s:L%n", longContext.substring(0, 128))));
auditlog.clearOutput();
// empty context is ignored
@@ -302,7 +303,8 @@ public class TestAuditLogger {
} catch (InterruptedException ignored) {
// Ignore
}
- assertTrue(auditlog.getOutput().endsWith("callerContext=setTimes:L\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=setTimes:L%n")));
auditlog.clearOutput();
// caller context is overridden in child thread
@@ -330,7 +332,7 @@ public class TestAuditLogger {
// Ignore
}
assertTrue(auditlog.getOutput().endsWith(
- "callerContext=setPermission:L\n"));
+ String.format("callerContext=setPermission:L%n")));
auditlog.clearOutput();
// reuse the current context's signature
@@ -339,7 +341,8 @@ public class TestAuditLogger {
CallerContext.setCurrent(context);
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.mkdirs(new Path("/reuse-context-signature"));
- assertTrue(auditlog.getOutput().endsWith("callerContext=mkdirs:L\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=mkdirs:L%n")));
auditlog.clearOutput();
// too long signature is ignored
@@ -349,7 +352,8 @@ public class TestAuditLogger {
CallerContext.setCurrent(context);
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.setTimes(p, time, time);
- assertTrue(auditlog.getOutput().endsWith("callerContext=setTimes\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=setTimes%n")));
auditlog.clearOutput();
// null signature is ignored
@@ -358,7 +362,8 @@ public class TestAuditLogger {
CallerContext.setCurrent(context);
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.setTimes(p, time, time);
- assertTrue(auditlog.getOutput().endsWith("callerContext=setTimes\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=setTimes%n")));
auditlog.clearOutput();
// empty signature is ignored
@@ -368,7 +373,8 @@ public class TestAuditLogger {
CallerContext.setCurrent(context);
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.mkdirs(new Path("/empty-signature"));
- assertTrue(auditlog.getOutput().endsWith("callerContext=mkdirs\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=mkdirs%n")));
auditlog.clearOutput();
// invalid context is not passed to the rpc
[2/2] hadoop git commit: HDFS-9362.
TestAuditLogger#testAuditLoggerWithCallContext assumes Unix line endings,
fails on Windows. Contributed by Chris Nauroth.
Posted by cn...@apache.org.
HDFS-9362. TestAuditLogger#testAuditLoggerWithCallContext assumes Unix line endings, fails on Windows. Contributed by Chris Nauroth.
(cherry picked from commit 7e2829662b4c4bf33ebaf2fa09312d0bed3d6f92)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/246ab44b
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/246ab44b
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/246ab44b
Branch: refs/heads/branch-2
Commit: 246ab44b5e7bb40bb7d840fc647e4a3725579f0c
Parents: 9d11d2a
Author: cnauroth <cn...@apache.org>
Authored: Tue Nov 3 11:54:57 2015 -0800
Committer: cnauroth <cn...@apache.org>
Committed: Tue Nov 3 11:55:07 2015 -0800
----------------------------------------------------------------------
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++
.../hdfs/server/namenode/TestAuditLogger.java | 24 ++++++++++++--------
2 files changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/246ab44b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 6d2b226..b67f340 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -1379,6 +1379,9 @@ Release 2.8.0 - UNRELEASED
HDFS-9354. Fix TestBalancer#testBalancerWithZeroThreadsForMove on Windows.
(Xiaoyu Yao via cnauroth)
+ HDFS-9362. TestAuditLogger#testAuditLoggerWithCallContext assumes Unix line
+ endings, fails on Windows. (cnauroth)
+
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES
http://git-wip-us.apache.org/repos/asf/hadoop/blob/246ab44b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java
index 252f7af..d637abc 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java
@@ -243,7 +243,8 @@ public class TestAuditLogger {
CallerContext.setCurrent(context);
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.setTimes(p, time, time);
- assertTrue(auditlog.getOutput().endsWith("callerContext=setTimes\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=setTimes%n")));
auditlog.clearOutput();
// context with signature
@@ -254,7 +255,7 @@ public class TestAuditLogger {
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.setTimes(p, time, time);
assertTrue(auditlog.getOutput().endsWith(
- "callerContext=setTimes:L\n"));
+ String.format("callerContext=setTimes:L%n")));
auditlog.clearOutput();
// long context is truncated
@@ -266,7 +267,7 @@ public class TestAuditLogger {
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.setTimes(p, time, time);
assertTrue(auditlog.getOutput().endsWith(
- "callerContext=" + longContext.substring(0, 128) + ":L\n"));
+ String.format("callerContext=%s:L%n", longContext.substring(0, 128))));
auditlog.clearOutput();
// empty context is ignored
@@ -302,7 +303,8 @@ public class TestAuditLogger {
} catch (InterruptedException ignored) {
// Ignore
}
- assertTrue(auditlog.getOutput().endsWith("callerContext=setTimes:L\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=setTimes:L%n")));
auditlog.clearOutput();
// caller context is overridden in child thread
@@ -330,7 +332,7 @@ public class TestAuditLogger {
// Ignore
}
assertTrue(auditlog.getOutput().endsWith(
- "callerContext=setPermission:L\n"));
+ String.format("callerContext=setPermission:L%n")));
auditlog.clearOutput();
// reuse the current context's signature
@@ -339,7 +341,8 @@ public class TestAuditLogger {
CallerContext.setCurrent(context);
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.mkdirs(new Path("/reuse-context-signature"));
- assertTrue(auditlog.getOutput().endsWith("callerContext=mkdirs:L\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=mkdirs:L%n")));
auditlog.clearOutput();
// too long signature is ignored
@@ -349,7 +352,8 @@ public class TestAuditLogger {
CallerContext.setCurrent(context);
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.setTimes(p, time, time);
- assertTrue(auditlog.getOutput().endsWith("callerContext=setTimes\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=setTimes%n")));
auditlog.clearOutput();
// null signature is ignored
@@ -358,7 +362,8 @@ public class TestAuditLogger {
CallerContext.setCurrent(context);
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.setTimes(p, time, time);
- assertTrue(auditlog.getOutput().endsWith("callerContext=setTimes\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=setTimes%n")));
auditlog.clearOutput();
// empty signature is ignored
@@ -368,7 +373,8 @@ public class TestAuditLogger {
CallerContext.setCurrent(context);
LOG.info("Set current caller context as {}", CallerContext.getCurrent());
fs.mkdirs(new Path("/empty-signature"));
- assertTrue(auditlog.getOutput().endsWith("callerContext=mkdirs\n"));
+ assertTrue(auditlog.getOutput().endsWith(
+ String.format("callerContext=mkdirs%n")));
auditlog.clearOutput();
// invalid context is not passed to the rpc