From a756d3e7c8eb573406d30593e761654fa77ee010 Mon Sep 17 00:00:00 2001 From: Inigo Goiri Date: Wed, 9 May 2018 16:52:09 -0700 Subject: [PATCH] HDFS-13537. TestHdfsHelper does not generate jceks path properly for relative path in Windows. Contributed by Xiao Liang. (cherry picked from commit 914b98a713f70667d4380ac752f6c4de931520d9) --- .../src/test/java/org/apache/hadoop/test/TestHdfsHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHdfsHelper.java b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHdfsHelper.java index 0e701f712e7..f57092dd05c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHdfsHelper.java +++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHdfsHelper.java @@ -157,8 +157,10 @@ public class TestHdfsHelper extends TestDirHelper { conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_ACLS_ENABLED_KEY, true); conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_XATTRS_ENABLED_KEY, true); FileSystemTestHelper helper = new FileSystemTestHelper(); + Path targetFile = new Path(new File(helper.getTestRootDir()) + .getAbsolutePath(), "test.jks"); final String jceksPath = JavaKeyStoreProvider.SCHEME_NAME + "://file" + - new Path(helper.getTestRootDir(), "test.jks").toUri(); + targetFile.toUri(); conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH, jceksPath); MiniDFSCluster.Builder builder = new MiniDFSCluster.Builder(conf);