diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index a76f2a8544a..a8966df15c1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -647,6 +647,9 @@ Release 2.7.0 - UNRELEASED HDFS-7564. NFS gateway dynamically reload UID/GID mapping file /etc/nfs.map (Yongjun Zhang via brandonli) + HDFS-7561. TestFetchImage should write fetched-image-dir under target. + (Liang Xie via shv) + Release 2.6.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFetchImage.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFetchImage.java index a8c6779b733..0d4435779aa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFetchImage.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFetchImage.java @@ -26,20 +26,27 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction; import org.apache.hadoop.hdfs.tools.DFSAdmin; import org.apache.hadoop.hdfs.util.MD5FileUtils; import org.apache.hadoop.io.MD5Hash; +import org.junit.AfterClass; import org.junit.Test; public class TestFetchImage { private static final File FETCHED_IMAGE_FILE = new File( - System.getProperty("build.test.dir"), "fetched-image-dir"); + System.getProperty("test.build.dir"), "target/fetched-image-dir"); // Shamelessly stolen from NNStorage. private static final Pattern IMAGE_REGEX = Pattern.compile("fsimage_(\\d+)"); + @AfterClass + public static void cleanup() { + FileUtil.fullyDelete(FETCHED_IMAGE_FILE); + } + /** * Download a few fsimages using `hdfs dfsadmin -fetchImage ...' and verify * the results.