Repository: hadoop
Updated Branches:
  refs/heads/branch-2.7 11e6c9678 -> 59fab4ea0


HDFS-11736. OIV tests should not write outside 'target' directory. Contributed 
by Yiqun Lin.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/59fab4ea
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/59fab4ea
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/59fab4ea

Branch: refs/heads/branch-2.7
Commit: 59fab4ea041f3d8269ed0ef60edd108b0ce57a0e
Parents: 11e6c96
Author: Akira Ajisaka <[email protected]>
Authored: Thu Jun 15 13:49:47 2017 +0900
Committer: Akira Ajisaka <[email protected]>
Committed: Thu Jun 15 13:49:53 2017 +0900

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                 | 3 +++
 .../apache/hadoop/hdfs/server/namenode/TestCheckpoint.java  | 6 ++++--
 .../hdfs/server/namenode/ha/TestStandbyCheckpoints.java     | 9 +++++++--
 3 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/59fab4ea/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 559a32e..0677600 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -352,6 +352,9 @@ Release 2.7.4 - UNRELEASED
     HDFS-11743. Revert the incompatible fsck reporting output in HDFS-7933
     from branch-2.7. (zhz)
 
+    HDFS-11736. OIV tests should not write outside 'target' directory.
+    (Yiqun Lin via aajisaka)
+
 Release 2.7.3 - 2016-08-25
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/59fab4ea/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
index 88adffe..a6509a7 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
@@ -44,7 +44,6 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Random;
 
-import com.google.common.io.Files;
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -2434,7 +2433,10 @@ public class TestCheckpoint {
   public void testLegacyOivImage() throws Exception {
     MiniDFSCluster cluster = null;
     SecondaryNameNode secondary = null;
-    File tmpDir = Files.createTempDir();
+    File tmpDir = new File(MiniDFSCluster.getBaseDirectory(),
+        "testLegacyOivImage");
+    tmpDir.mkdirs();
+
     Configuration conf = new HdfsConfiguration();
     conf.set(DFSConfigKeys.DFS_NAMENODE_LEGACY_OIV_IMAGE_DIR_KEY,
         tmpDir.getAbsolutePath());

http://git-wip-us.apache.org/repos/asf/hadoop/blob/59fab4ea/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java
index 720f558..b4a1d3c 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java
@@ -21,7 +21,6 @@ import com.google.common.base.Supplier;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Lists;
-import com.google.common.io.Files;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -114,7 +113,9 @@ public class TestStandbyCheckpoints {
   }
 
   protected Configuration setupCommonConfig() {
-    tmpOivImgDir = Files.createTempDir();
+    tmpOivImgDir = new File(MiniDFSCluster.getBaseDirectory(),
+        "TestStandbyCheckpoints");
+    tmpOivImgDir.mkdirs();
 
     Configuration conf = new Configuration();
     conf.setInt(DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_CHECK_PERIOD_KEY, 1);
@@ -135,6 +136,10 @@ public class TestStandbyCheckpoints {
     if (cluster != null) {
       cluster.shutdown();
     }
+
+    if (tmpOivImgDir != null) {
+      FileUtil.fullyDelete(tmpOivImgDir);
+    }
   }
 
   @Test(timeout = 300000)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to