ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stoa...@apache.org
Subject ambari git commit: AMBARI-18359. Get LDAP tests to run in concurrent forked JVMs. (Attila Doroszlai via stoader)
Date Tue, 13 Sep 2016 08:30:07 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 aa1c7b9b2 -> a09edf327


AMBARI-18359. Get LDAP tests to run in concurrent forked JVMs. (Attila Doroszlai via stoader)

Change-Id: I89cd272d14c45a8078cba9a020e0148af63d0559


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

Branch: refs/heads/branch-2.5
Commit: a09edf3272cd2b03d2ecd22882df330e30c9950b
Parents: aa1c7b9
Author: Attila Doroszlai <adoroszlai@hortonworks.com>
Authored: Tue Sep 13 10:15:58 2016 +0200
Committer: Toader, Sebastian <stoader@hortonworks.com>
Committed: Tue Sep 13 10:29:57 2016 +0200

----------------------------------------------------------------------
 .../AmbariLdapAuthenticationProviderForDNWithSpaceTest.java    | 5 +++--
 .../AmbariLdapAuthenticationProviderForDuplicateUserTest.java  | 5 +++--
 .../authorization/AmbariLdapAuthenticationProviderTest.java    | 5 +++--
 .../authorization/AmbariLdapBindAuthenticatorTest.java         | 6 +++---
 4 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a09edf32/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDNWithSpaceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDNWithSpaceTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDNWithSpaceTest.java
index 1a18ff2..95b1860 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDNWithSpaceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDNWithSpaceTest.java
@@ -43,7 +43,7 @@ import static org.junit.Assert.*;
 
 @RunWith(FrameworkRunner.class)
 @CreateDS(allowAnonAccess = true,
-    name = "Test",
+    name = "AmbariLdapAuthenticationProviderForDNWithSpaceTest",
     partitions = {
         @CreatePartition(name = "Root",
             suffix = "dc=the apache,dc=org",
@@ -59,7 +59,7 @@ import static org.junit.Assert.*;
                         "objectClass: domain\n\n"))
     })
 @CreateLdapServer(allowAnonymousAccess = true,
-    transports = {@CreateTransport(protocol = "LDAP", port = 33389)})
+    transports = {@CreateTransport(protocol = "LDAP")})
 @ApplyLdifFiles("users_for_dn_with_space.ldif")
 public class AmbariLdapAuthenticationProviderForDNWithSpaceTest extends AmbariLdapAuthenticationProviderBaseTest
{
 
@@ -80,6 +80,7 @@ public class AmbariLdapAuthenticationProviderForDNWithSpaceTest extends
AmbariLd
     injector.injectMembers(this);
     injector.getInstance(GuiceJpaInitializer.class);
     configuration.setClientSecurityType(ClientSecurityType.LDAP);
+    configuration.setProperty(Configuration.LDAP_PRIMARY_URL, "localhost:" + getLdapServer().getPort());
   }
 
   @After

http://git-wip-us.apache.org/repos/asf/ambari/blob/a09edf32/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDuplicateUserTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDuplicateUserTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDuplicateUserTest.java
index c0086d6..03bf83d 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDuplicateUserTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDuplicateUserTest.java
@@ -41,7 +41,7 @@ import org.springframework.security.core.Authentication;
 
 @RunWith(FrameworkRunner.class)
 @CreateDS(allowAnonAccess = true,
-  name = "Test",
+  name = "AmbariLdapAuthenticationProviderForDuplicateUserTest",
   partitions = {
     @CreatePartition(name = "Root",
       suffix = "dc=apache,dc=org",
@@ -57,7 +57,7 @@ import org.springframework.security.core.Authentication;
             "objectClass: domain\n\n"))
   })
 @CreateLdapServer(allowAnonymousAccess = true,
-  transports = {@CreateTransport(protocol = "LDAP", port = 33389)})
+  transports = {@CreateTransport(protocol = "LDAP")})
 @ApplyLdifFiles("users_with_duplicate_uid.ldif")
 public class AmbariLdapAuthenticationProviderForDuplicateUserTest extends AmbariLdapAuthenticationProviderBaseTest
{
 
@@ -85,6 +85,7 @@ public class AmbariLdapAuthenticationProviderForDuplicateUserTest extends
Ambari
     properties.setProperty(Configuration.OS_VERSION.getKey(),"centos5");
     properties.setProperty(Configuration.SHARED_RESOURCES_DIR.getKey(), "src/test/resources/");
     properties.setProperty(Configuration.LDAP_BASE_DN.getKey(), "dc=apache,dc=org");
+    properties.setProperty(Configuration.LDAP_PRIMARY_URL.getKey(), "localhost:" + getLdapServer().getPort());
 
     Configuration configuration = new Configuration(properties);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a09edf32/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderTest.java
index 779b0a2..2a2e2a3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderTest.java
@@ -57,7 +57,7 @@ import junit.framework.Assert;
 
 @RunWith(FrameworkRunner.class)
 @CreateDS(allowAnonAccess = true,
-    name = "Test",
+    name = "AmbariLdapAuthenticationProviderTest",
     partitions = {
         @CreatePartition(name = "Root",
             suffix = "dc=apache,dc=org",
@@ -73,7 +73,7 @@ import junit.framework.Assert;
                         "objectClass: domain\n\n"))
     })
 @CreateLdapServer(allowAnonymousAccess = true,
-    transports = {@CreateTransport(protocol = "LDAP", port = 33389)})
+    transports = {@CreateTransport(protocol = "LDAP")})
 @ApplyLdifFiles("users.ldif")
 public class AmbariLdapAuthenticationProviderTest extends AmbariLdapAuthenticationProviderBaseTest
{
 
@@ -96,6 +96,7 @@ public class AmbariLdapAuthenticationProviderTest extends AmbariLdapAuthenticati
     configuration.setClientSecurityType(ClientSecurityType.LDAP);
     configuration.setProperty(Configuration.LDAP_ALT_USER_SEARCH_FILTER.getKey(), "(&(mail={0})(objectClass={userObjectClass}))");
     configuration.setProperty(Configuration.LDAP_ALT_USER_SEARCH_ENABLED.getKey(), "false");
+    configuration.setProperty(Configuration.LDAP_PRIMARY_URL, "localhost:" + getLdapServer().getPort());
   }
 
   @After

http://git-wip-us.apache.org/repos/asf/ambari/blob/a09edf32/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticatorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticatorTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticatorTest.java
index 1716c97..6e4b836 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticatorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticatorTest.java
@@ -52,7 +52,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
 
 @RunWith(FrameworkRunner.class)
 @CreateDS(allowAnonAccess = true,
-  name = "Test",
+  name = "AmbariLdapBindAuthenticatorTest",
   partitions = {
     @CreatePartition(name = "Root",
       suffix = "dc=apache,dc=org",
@@ -68,7 +68,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
             "objectClass: domain\n\n"))
   })
 @CreateLdapServer(allowAnonymousAccess = true,
-  transports = {@CreateTransport(protocol = "LDAP", port = 33389)})
+  transports = {@CreateTransport(protocol = "LDAP")})
 @ApplyLdifFiles("users.ldif")
 public class AmbariLdapBindAuthenticatorTest extends AmbariLdapAuthenticationProviderBaseTest
{
 
@@ -88,7 +88,7 @@ public class AmbariLdapBindAuthenticatorTest extends AmbariLdapAuthenticationPro
     // Given
 
     LdapContextSource ldapCtxSource = new LdapContextSource();
-    ldapCtxSource.setUrls(new String[] {"ldap://localhost:33389"});
+    ldapCtxSource.setUrls(new String[] {"ldap://localhost:" + getLdapServer().getPort()});
     ldapCtxSource.setBase("dc=ambari,dc=apache,dc=org");
     ldapCtxSource.afterPropertiesSet();
 


Mime
View raw message