directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1484387 - in /directory/apacheds/trunk: kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
Date Mon, 20 May 2013 07:41:25 GMT
Author: elecharny
Date: Mon May 20 07:41:25 2013
New Revision: 1484387

URL: http://svn.apache.org/r1484387
Log:
Fixed failing tests on kerberos and sasl. This is due to the way Java resolves localhost.

Modified:
    directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java

Modified: directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java?rev=1484387&r1=1484386&r2=1484387&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java
(original)
+++ directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java
Mon May 20 07:41:25 2013
@@ -24,8 +24,6 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.fail;
 
 import java.io.IOException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
 import java.security.PrivilegedAction;
 import java.util.Hashtable;
 
@@ -170,19 +168,7 @@ public class SaslGssapiBindITest extends
         // On Windows 7 and Server 2008 the loopback address 127.0.0.1
         // isn't resolved to localhost by default. In that case we need
         // to use the IP address for the service principal.
-        String hostName;
-        
-        try
-        {
-            InetAddress loopback = InetAddress.getByName( "127.0.0.1" );
-            hostName = loopback.getHostName();
-        }
-        catch ( UnknownHostException e )
-        {
-            System.err.println( "Can't find loopback address '127.0.0.1', using hostname
'localhost'" );
-            hostName = "localhost";
-        }
-        
+        String hostName = "localhost";
         String servicePrincipal = "ldap/" + hostName + "@EXAMPLE.COM";
         getLdapServer().setSaslPrincipal( servicePrincipal );
 
@@ -197,7 +183,7 @@ public class SaslGssapiBindITest extends
         // check if krb5kdc is disabled
         Attributes krb5kdcAttrs = schemaRoot.getAttributes( "cn=Krb5kdc" );
         boolean isKrb5KdcDisabled = false;
-        
+
         if ( krb5kdcAttrs.get( "m-disabled" ) != null )
         {
             isKrb5KdcDisabled = ( ( String ) krb5kdcAttrs.get( "m-disabled" ).get() ).equalsIgnoreCase(
"TRUE" );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java?rev=1484387&r1=1484386&r2=1484387&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
Mon May 20 07:41:25 2013
@@ -208,10 +208,11 @@ public class SaslBindIT extends Abstract
         // isn't resolved to localhost by default. In that case we need
         // to use the IP address for the service principal.
         String hostName;
+
         try
         {
             InetAddress loopback = InetAddress.getByName( "127.0.0.1" );
-            hostName = loopback.getHostName();
+            hostName = "localhost";
         }
         catch ( UnknownHostException e )
         {
@@ -502,6 +503,7 @@ public class SaslBindIT extends Abstract
      * Tests to make sure GSS-API binds below the RootDSE work.
      */
     @Test
+    //@Ignore("Fails on ac OSX")
     public void testSaslGssApiBind() throws Exception
     {
         Dn userDn = new Dn( "uid=hnelson,ou=users,dc=example,dc=com" );



Mime
View raw message