You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-commits@hadoop.apache.org by el...@apache.org on 2010/11/15 08:31:16 UTC

svn commit: r1035163 - in /hadoop/hdfs/trunk: CHANGES.txt src/test/hdfs/org/apache/hadoop/fs/TestFcHdfsSymlink.java

Author: eli
Date: Mon Nov 15 07:31:16 2010
New Revision: 1035163

URL: http://svn.apache.org/viewvc?rev=1035163&view=rev
Log:
HDFS-1466. TestFcHdfsSymlink relies on /tmp/test not existing. Contributed by Eli Collins

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/TestFcHdfsSymlink.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1035163&r1=1035162&r2=1035163&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Mon Nov 15 07:31:16 2010
@@ -334,6 +334,8 @@ Trunk (unreleased changes)
     HDFS-1498. FSDirectory#unprotectedConcat calls setModificationTime 
     on a file. (eli)
 
+    HDFS-1466. TestFcHdfsSymlink relies on /tmp/test not existing. (eli)
+
 Release 0.21.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/TestFcHdfsSymlink.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/TestFcHdfsSymlink.java?rev=1035163&r1=1035162&r2=1035163&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/TestFcHdfsSymlink.java (original)
+++ hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/TestFcHdfsSymlink.java Mon Nov 15 07:31:16 2010
@@ -29,6 +29,7 @@ import org.apache.hadoop.hdfs.DFSConfigK
 import org.apache.hadoop.hdfs.HdfsConfiguration;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.hdfs.protocol.FSConstants;
+import static org.apache.hadoop.fs.FileContextTestHelper.*;
 import org.apache.hadoop.ipc.RemoteException;
 import static org.junit.Assert.*;
 import org.junit.Test;
@@ -46,11 +47,11 @@ public class TestFcHdfsSymlink extends F
     return "hdfs";
   }
 
-  protected String testBaseDir1() {
+  protected String testBaseDir1() throws IOException {
     return "/test1";
   }
   
-  protected String testBaseDir2() {
+  protected String testBaseDir2() throws IOException {
     return "/test2";
   }
 
@@ -83,11 +84,11 @@ public class TestFcHdfsSymlink extends F
   @Test
   /** Link from Hdfs to LocalFs */
   public void testLinkAcrossFileSystems() throws IOException {
-    Path localDir  = new Path("file:///tmp/test");
-    Path localFile = new Path("file:///tmp/test/file");
+    Path localDir  = new Path("file://"+getAbsoluteTestRootDir(fc)+"/test");
+    Path localFile = new Path("file://"+getAbsoluteTestRootDir(fc)+"/test/file");
     Path link      = new Path(testBaseDir1(), "linkToFile");
     FileContext localFc = FileContext.getLocalFSFileContext();
-    localFc.delete(new Path("file:///tmp/test"), true);
+    localFc.delete(localDir, true);
     localFc.mkdir(localDir, FileContext.DEFAULT_PERM, true);
     localFc.setWorkingDirectory(localDir);
     assertEquals(localDir, localFc.getWorkingDirectory());