hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject [hadoop] branch trunk updated: HADOOP-16031. Fixed TestSecureLogins unit test. Contributed by Akira Ajisaka
Date Mon, 07 Jan 2019 18:22:17 GMT
This is an automated email from the ASF dual-hosted git repository.

eyang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 802932c  HADOOP-16031.  Fixed TestSecureLogins unit test.  Contributed by Akira Ajisaka
802932c is described below

commit 802932ca0b10348634b5b5d7f8e7868ce93322f2
Author: Eric Yang <eyang@apache.org>
AuthorDate: Mon Jan 7 13:21:14 2019 -0500

    HADOOP-16031.  Fixed TestSecureLogins unit test.  Contributed by Akira Ajisaka
---
 .../org/apache/hadoop/registry/secure/TestSecureLogins.java | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/hadoop-common-project/hadoop-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureLogins.java
b/hadoop-common-project/hadoop-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureLogins.java
index ee15c0a..1cdc47d 100644
--- a/hadoop-common-project/hadoop-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureLogins.java
+++ b/hadoop-common-project/hadoop-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureLogins.java
@@ -43,6 +43,10 @@ import org.apache.hadoop.security.authentication.util.KerberosName;
 import org.apache.hadoop.security.authentication.util.KerberosUtil;
 import org.apache.hadoop.registry.client.impl.zk.RegistrySecurity;
 import org.apache.hadoop.registry.client.impl.zk.ZookeeperConfigOptions;
+
+import static org.apache.hadoop.security.authentication.util.KerberosName.DEFAULT_MECHANISM;
+import static org.apache.hadoop.security.authentication.util.KerberosName.MECHANISM_HADOOP;
+import static org.apache.hadoop.security.authentication.util.KerberosName.MECHANISM_MIT;
 import static org.apache.hadoop.util.PlatformName.IBM_JAVA;
 
 import org.junit.Test;
@@ -198,12 +202,15 @@ public class TestSecureLogins extends AbstractSecureRegistryTest {
 
   @Test
   public void testValidKerberosName() throws Throwable {
-
+    KerberosName.setRuleMechanism(MECHANISM_HADOOP);
+    new HadoopKerberosName(ZOOKEEPER).getShortName();
+    // MECHANISM_MIT allows '/' and '@' in username
+    KerberosName.setRuleMechanism(MECHANISM_MIT);
     new HadoopKerberosName(ZOOKEEPER).getShortName();
     new HadoopKerberosName(ZOOKEEPER_LOCALHOST).getShortName();
     new HadoopKerberosName(ZOOKEEPER_REALM).getShortName();
-    // standard rules don't pick this up
-    // new HadoopKerberosName(ZOOKEEPER_LOCALHOST_REALM).getShortName();
+    new HadoopKerberosName(ZOOKEEPER_LOCALHOST_REALM).getShortName();
+    KerberosName.setRuleMechanism(DEFAULT_MECHANISM);
   }
 
   @Test


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


Mime
View raw message