HDFS-13651. TestReencryptionHandler fails on Windows. Contributed by Anbang Hu.

(cherry picked from commit e308ac88d399e9bed3581ff4b1450aa2070dcedf)


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

Branch: refs/remotes/origin/branch-3.1
Commit: 8a9c2d7b97c2c81ce2547fe714a3641c5ce8adaa
Parents: e59e9fe
Author: Inigo Goiri <inigo...@apache.org>
Authored: Sat Jun 2 20:12:35 2018 -0700
Committer: Inigo Goiri <inigo...@apache.org>
Committed: Sat Jun 2 20:13:21 2018 -0700

----------------------------------------------------------------------
 .../hadoop/hdfs/server/namenode/TestReencryptionHandler.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/8a9c2d7b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryptionHandler.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryptionHandler.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryptionHandler.java
index 3481b42..ae9b2be 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryptionHandler.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryptionHandler.java
@@ -36,6 +36,7 @@ import org.mockito.internal.util.reflection.Whitebox;
 import org.slf4j.LoggerFactory;
 import org.slf4j.event.Level;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
@@ -67,9 +68,11 @@ public class TestReencryptionHandler {
   private ReencryptionHandler mockReencryptionhandler(final Configuration conf)
       throws IOException {
     // mock stuff to create a mocked ReencryptionHandler
+    FileSystemTestHelper helper = new FileSystemTestHelper();
+    Path targetFile = new Path(new File(helper.getTestRootDir())
+        .getAbsolutePath(), "test.jks");
     conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
-        JavaKeyStoreProvider.SCHEME_NAME + "://file" + new Path(
-            new FileSystemTestHelper().getTestRootDir(), "test.jks").toUri());
+        JavaKeyStoreProvider.SCHEME_NAME + "://file" + targetFile.toUri());
     final EncryptionZoneManager ezm = 
Mockito.mock(EncryptionZoneManager.class);
     final KeyProvider kp = KMSUtil.createKeyProvider(conf,
         CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to