You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by st...@apache.org on 2016/09/13 08:27:05 UTC
ambari git commit: AMBARI-18359. Get LDAP tests to run in concurrent
forked JVMs. (Attila Doroszlai via stoader)
Repository: ambari
Updated Branches:
refs/heads/trunk d8f3cf88f -> e16d916b1
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/e16d916b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e16d916b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e16d916b
Branch: refs/heads/trunk
Commit: e16d916b1318d456b96cde658b5911853bfec32d
Parents: d8f3cf8
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Tue Sep 13 10:15:58 2016 +0200
Committer: Toader, Sebastian <st...@hortonworks.com>
Committed: Tue Sep 13 10:16:44 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/e16d916b/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/e16d916b/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/e16d916b/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/e16d916b/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();