Jelajahi Sumber

HDFS-1240. TestDFSShell failing in branch-20. Contributed by Todd Lipcon.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20@1032810 13f79535-47bb-0310-9956-ffa450edef68
Eli Collins 14 tahun lalu
induk
melakukan
64a536aa7a

+ 3 - 0
CHANGES.txt

@@ -62,6 +62,9 @@ Release 0.20.3 - Unreleased
     HADOOP-6724. IPC doesn't properly handle IOEs thrown by socket factory.
     (Todd Lipcon via Eli Collins)
 
+    HDFS-1240. TestDFSShell failing in branch-20.
+    (Todd Lipcon via Eli Collins)
+
   IMPROVEMENTS
 
     MAPREDUCE-1407. Update javadoc in mapreduce.{Mapper,Reducer} to match

+ 6 - 4
src/test/org/apache/hadoop/hdfs/MiniDFSCluster.java

@@ -51,9 +51,6 @@ import org.apache.hadoop.util.ToolRunner;
  */
 public class MiniDFSCluster {
 
-  public static final File BASE_DIR =
-    new File(System.getProperty("test.build.data", "build/test/data"), "dfs/");
-  
   public class DataNodeProperties {
     DataNode datanode;
     Configuration conf;
@@ -242,7 +239,7 @@ public class MiniDFSCluster {
       ioe.initCause(e);
       throw ioe;
     }
-    base_dir = BASE_DIR;
+    base_dir = getBaseDir();
     data_dir = new File(base_dir, "data");
     
     // Setup the NameNode configuration
@@ -839,4 +836,9 @@ public class MiniDFSCluster {
   public String getDataDirectory() {
     return data_dir.getAbsolutePath();
   }
+
+  public static File getBaseDir() {
+    return new File(System.getProperty(
+      "test.build.data", "build/test/data"), "dfs/");
+  }
 }

+ 1 - 1
src/test/org/apache/hadoop/hdfs/server/namenode/TestEditLogRace.java

@@ -287,7 +287,7 @@ public class TestEditLogRace extends TestCase {
  
   private Configuration getConf() {
     Configuration conf = new Configuration();
-    conf.set("dfs.name.dir", MiniDFSCluster.BASE_DIR + "/data");
+    conf.set("dfs.name.dir", MiniDFSCluster.getBaseDir() + "/data");
     conf.setBoolean("dfs.permissions", false);
     return conf;
   }