From dc2ebf88a8e6fdf752b3f67933ff6c276ab90921 Mon Sep 17 00:00:00 2001 From: cnauroth Date: Thu, 25 Sep 2014 11:17:46 -0700 Subject: [PATCH] HDFS-7111. TestSafeMode assumes Unix line endings in safe mode tip. Contributed by Chris Nauroth. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../test/java/org/apache/hadoop/hdfs/TestSafeMode.java | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index ec4674ba1cd..bde6fde7f9b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -950,6 +950,9 @@ Release 2.6.0 - UNRELEASED HDFS-6534. Fix build on macosx: HDFS parts (Binglin Chang via aw) + HDFS-7111. TestSafeMode assumes Unix line endings in safe mode tip. + (cnauroth) + Release 2.5.1 - 2014-09-05 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestSafeMode.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestSafeMode.java index 3db66f52c94..5c78dbe304a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestSafeMode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestSafeMode.java @@ -66,6 +66,7 @@ public class TestSafeMode { public static final Log LOG = LogFactory.getLog(TestSafeMode.class); private static final Path TEST_PATH = new Path("/test"); private static final int BLOCK_SIZE = 1024; + private static final String NEWLINE = System.getProperty("line.separator"); Configuration conf; MiniDFSCluster cluster; FileSystem fs; @@ -196,7 +197,7 @@ public class TestSafeMode { String status = nn.getNamesystem().getSafemode(); assertEquals("Safe mode is ON. The reported blocks 0 needs additional " + - "15 blocks to reach the threshold 0.9990 of total blocks 15.\n" + + "15 blocks to reach the threshold 0.9990 of total blocks 15." + NEWLINE + "The number of live datanodes 0 has reached the minimum number 0. " + "Safe mode will be turned off automatically once the thresholds " + "have been reached.", status); @@ -448,9 +449,9 @@ public class TestSafeMode { String tipMsg = cluster.getNamesystem().getSafemode(); assertTrue("Safemode tip message doesn't look right: " + tipMsg, - tipMsg.contains("The number of live datanodes 0 needs an additional " + - "1 live datanodes to reach the minimum number 1.\n" + - "Safe mode will be turned off automatically")); + tipMsg.contains("The number of live datanodes 0 needs an additional " + + "1 live datanodes to reach the minimum number 1." + + NEWLINE + "Safe mode will be turned off automatically")); // Start a datanode cluster.startDataNodes(conf, 1, true, null, null);