hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnaur...@apache.org
Subject git commit: Credential Provider related Unit Test Failure on Windows. Contributed by Xiaoyu Yao.
Date Mon, 08 Sep 2014 16:32:51 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 c17810a84 -> 17b44f11f


Credential Provider related Unit Test Failure on Windows. Contributed by Xiaoyu Yao.

(cherry picked from commit 302d9a0a0dac721775a88f804a18d5224c0cd497)


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

Branch: refs/heads/branch-2
Commit: 17b44f11f87112fb7c02e94bd6df489919403b99
Parents: c17810a
Author: cnauroth <cnauroth@apache.org>
Authored: Mon Sep 8 09:29:19 2014 -0700
Committer: cnauroth <cnauroth@apache.org>
Committed: Mon Sep 8 09:31:32 2014 -0700

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt |  3 +++
 .../crypto/key/TestKeyProviderFactory.java      | 24 +++++++++++---------
 .../hadoop/security/TestLdapGroupsMapping.java  |  4 +++-
 .../alias/TestCredentialProviderFactory.java    | 17 +++++++-------
 .../hadoop/security/ssl/KeyStoreTestUtil.java   |  4 +++-
 .../hadoop/security/ssl/TestSSLFactory.java     |  4 +++-
 6 files changed, 34 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/17b44f11/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index c799e20..ed7b5f8 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -427,6 +427,9 @@ Release 2.6.0 - UNRELEASED
     HADOOP-11069. KMSClientProvider should use getAuthenticationMethod() to
     determine if in proxyuser mode or not. (tucu)
 
+    HADOOP-11073. Credential Provider related Unit Tests Failure on Windows.
+    (Xiaoyu Yao via cnauroth)
+
 Release 2.5.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/17b44f11/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/key/TestKeyProviderFactory.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/key/TestKeyProviderFactory.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/key/TestKeyProviderFactory.java
index 8c4c7b3..8fb661d 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/key/TestKeyProviderFactory.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/key/TestKeyProviderFactory.java
@@ -55,18 +55,18 @@ public class TestKeyProviderFactory {
   @Test
   public void testFactory() throws Exception {
     Configuration conf = new Configuration();
+    final String userUri = UserProvider.SCHEME_NAME + ":///";
+    final Path jksPath = new Path(tmpDir.toString(), "test.jks");
+    final String jksUri = JavaKeyStoreProvider.SCHEME_NAME +
+        "://file" + jksPath.toUri().toString();
     conf.set(KeyProviderFactory.KEY_PROVIDER_PATH,
-        UserProvider.SCHEME_NAME + ":///," +
-            JavaKeyStoreProvider.SCHEME_NAME + "://file" + tmpDir + "/test.jks");
+        userUri + "," + jksUri);
     List<KeyProvider> providers = KeyProviderFactory.getProviders(conf);
     assertEquals(2, providers.size());
     assertEquals(UserProvider.class, providers.get(0).getClass());
     assertEquals(JavaKeyStoreProvider.class, providers.get(1).getClass());
-    assertEquals(UserProvider.SCHEME_NAME +
-        ":///", providers.get(0).toString());
-    assertEquals(JavaKeyStoreProvider.SCHEME_NAME +
-        "://file" + tmpDir + "/test.jks",
-        providers.get(1).toString());
+    assertEquals(userUri, providers.get(0).toString());
+    assertEquals(jksUri, providers.get(1).toString());
   }
 
   @Test
@@ -207,8 +207,9 @@ public class TestKeyProviderFactory {
   @Test
   public void testJksProvider() throws Exception {
     Configuration conf = new Configuration();
+    final Path jksPath = new Path(tmpDir.toString(), "test.jks");
     final String ourUrl =
-        JavaKeyStoreProvider.SCHEME_NAME + "://file" + tmpDir + "/test.jks";
+        JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri();
 
     File file = new File(tmpDir, "test.jks");
     file.delete();
@@ -317,8 +318,9 @@ public class TestKeyProviderFactory {
   @Test
   public void testJksProviderPasswordViaConfig() throws Exception {
     Configuration conf = new Configuration();
+    final Path jksPath = new Path(tmpDir.toString(), "test.jks");
     final String ourUrl =
-        JavaKeyStoreProvider.SCHEME_NAME + "://file" + tmpDir + "/test.jks";
+        JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri();
     File file = new File(tmpDir, "test.jks");
     file.delete();
     try {
@@ -360,8 +362,8 @@ public class TestKeyProviderFactory {
   @Test
   public void testGetProviderViaURI() throws Exception {
     Configuration conf = new Configuration(false);
-    URI uri = new URI(JavaKeyStoreProvider.SCHEME_NAME + "://file" + tmpDir +
-        "/test.jks");
+    final Path jksPath = new Path(tmpDir.toString(), "test.jks");
+    URI uri = new URI(JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri());
     KeyProvider kp = KeyProviderFactory.get(uri, conf);
     Assert.assertNotNull(kp);
     Assert.assertEquals(JavaKeyStoreProvider.class, kp.getClass());

http://git-wip-us.apache.org/repos/asf/hadoop/blob/17b44f11/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestLdapGroupsMapping.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestLdapGroupsMapping.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestLdapGroupsMapping.java
index 95cbc0a..a021a8a 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestLdapGroupsMapping.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestLdapGroupsMapping.java
@@ -40,6 +40,7 @@ import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.security.alias.CredentialProvider;
 import org.apache.hadoop.security.alias.CredentialProviderFactory;
 import org.apache.hadoop.security.alias.JavaKeyStoreProvider;
@@ -165,8 +166,9 @@ public class TestLdapGroupsMapping {
     File testDir = new File(System.getProperty("test.build.data",
                                                "target/test-dir"));
     Configuration conf = new Configuration();
+    final Path jksPath = new Path(testDir.toString(), "test.jks");
     final String ourUrl =
-        JavaKeyStoreProvider.SCHEME_NAME + "://file/" + testDir + "/test.jks";
+        JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri();
 
     File file = new File(testDir, "test.jks");
     file.delete();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/17b44f11/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/alias/TestCredentialProviderFactory.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/alias/TestCredentialProviderFactory.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/alias/TestCredentialProviderFactory.java
index 3d8794f..1eb1e8b 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/alias/TestCredentialProviderFactory.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/alias/TestCredentialProviderFactory.java
@@ -52,19 +52,19 @@ public class TestCredentialProviderFactory {
   @Test
   public void testFactory() throws Exception {
     Configuration conf = new Configuration();
+    final String userUri = UserProvider.SCHEME_NAME + ":///";
+    final Path jksPath = new Path(tmpDir.toString(), "test.jks");
+    final String jksUri = JavaKeyStoreProvider.SCHEME_NAME +
+        "://file" + jksPath.toUri();
     conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH,
-        UserProvider.SCHEME_NAME + ":///," +
-            JavaKeyStoreProvider.SCHEME_NAME + "://file" + tmpDir + "/test.jks");
+        userUri + "," + jksUri);
     List<CredentialProvider> providers = 
         CredentialProviderFactory.getProviders(conf);
     assertEquals(2, providers.size());
     assertEquals(UserProvider.class, providers.get(0).getClass());
     assertEquals(JavaKeyStoreProvider.class, providers.get(1).getClass());
-    assertEquals(UserProvider.SCHEME_NAME +
-        ":///", providers.get(0).toString());
-    assertEquals(JavaKeyStoreProvider.SCHEME_NAME +
-        "://file" + tmpDir + "/test.jks",
-        providers.get(1).toString());
+    assertEquals(userUri, providers.get(0).toString());
+    assertEquals(jksUri, providers.get(1).toString());
   }
 
   @Test
@@ -188,8 +188,9 @@ public class TestCredentialProviderFactory {
   @Test
   public void testJksProvider() throws Exception {
     Configuration conf = new Configuration();
+    final Path jksPath = new Path(tmpDir.toString(), "test.jks");
     final String ourUrl =
-        JavaKeyStoreProvider.SCHEME_NAME + "://file" + tmpDir + "/test.jks";
+        JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri();
 
     File file = new File(tmpDir, "test.jks");
     file.delete();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/17b44f11/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java
index 5f72f9e..b2a839c 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java
@@ -19,6 +19,7 @@
 package org.apache.hadoop.security.ssl;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.security.alias.CredentialProvider;
 import org.apache.hadoop.security.alias.CredentialProviderFactory;
 import org.apache.hadoop.security.alias.JavaKeyStoreProvider;
@@ -392,8 +393,9 @@ public class KeyStoreTestUtil {
         "target/test-dir"));
 
     Configuration conf = new Configuration();
+    final Path jksPath = new Path(testDir.toString(), "test.jks");
     final String ourUrl =
-    JavaKeyStoreProvider.SCHEME_NAME + "://file/" + testDir + "/test.jks";
+    JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri();
 
     File file = new File(testDir, "test.jks");
     file.delete();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/17b44f11/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestSSLFactory.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestSSLFactory.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestSSLFactory.java
index 3c428fe..004888c 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestSSLFactory.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestSSLFactory.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertEquals;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileUtil;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.security.alias.CredentialProvider;
 import org.apache.hadoop.security.alias.CredentialProviderFactory;
 import org.apache.hadoop.security.alias.JavaKeyStoreProvider;
@@ -305,8 +306,9 @@ public class TestSSLFactory {
       if (useCredProvider) {
         File testDir = new File(System.getProperty("test.build.data",
             "target/test-dir"));
+        final Path jksPath = new Path(testDir.toString(), "test.jks");
         final String ourUrl =
-            JavaKeyStoreProvider.SCHEME_NAME + "://file/" + testDir + "/test.jks";
+            JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri();
         sslConf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, ourUrl);
       }
     } else {


Mime
View raw message