Commit 2449b73d authored by opencadc-admin's avatar opencadc-admin Committed by GitHub
Browse files

Merge pull request #2 from andamian/s1965

S1965
parents 0a5a738e dbdecc3b
#LDAP server user DN password
devLdap uid=testuser,ou=testorg,dc=test secret NA NA
###############################################################
#
# Test ldap config #1
#
#
###############################################################
# Read-only connection pool
readOnly.servers = server1 server2 server3
readOnly.poolInitSize = 3
readOnly.poolMaxSize = 8
readOnly.poolPolicy = roundRobin
readOnly.maxWait = 30000
readOnly.createIfNeeded = false
# Read-write connection pool
readWrite.servers = server4 server5
readWrite.poolInitSize = 4
readWrite.poolMaxSize = 9
readWrite.poolPolicy = fewestConnections
readWrite.maxWait = 30000
readWrite.createIfNeeded = false
# Unbound-Read-only connection pool
unboundReadOnly.servers = server1 server2 server3
unboundReadOnly.poolInitSize = 3
unboundReadOnly.poolMaxSize = 8
unboundReadOnly.poolPolicy = roundRobin
unboundReadOnly.maxWait = 30000
unboundReadOnly.createIfNeeded = false
# server configuration -- applies to all servers
dbrcHost = devLdap
port = 389
proxyUser = uid=testuser,ou=testorg,dc=test
usersDN = usersDN
userRequestsDN = userRequestsDN
groupsDN = groupsDN
adminGroupsDN = adminGroupsDN
......@@ -32,8 +32,8 @@ unboundReadOnly.createIfNeeded = false
# server configuration -- applies to all servers
dbrcHost = devLdap
port = 389
proxyUser = uid=testproxy,ou=SpecialUsers,dc=testcanfar
proxyUser = uid=testuser,ou=testorg,dc=test
usersDN = usersDN
userRequestsDN = userRequestsDN
groupsDN = groupsDN
adminGroupsDN = adminGroupsDN
\ No newline at end of file
adminGroupsDN = adminGroupsDN
......@@ -32,8 +32,8 @@ unboundReadOnly.createIfNeeded = false
# server configuration -- applies to all servers
dbrcHost = devLdap
port = 389
proxyUser = uid=testproxy,ou=SpecialUsers,dc=testcanfar
proxyUser = uid=testuser,ou=testorg,dc=test
usersDN = usersDN
userRequestsDN = userRequestsDN
groupsDN = groupsDN
adminGroupsDN = adminGroupsDN
\ No newline at end of file
adminGroupsDN = adminGroupsDN
......@@ -32,8 +32,8 @@ unboundReadOnly.createIfNeeded = false
# server configuration -- applies to all servers
dbrcHost = devLdap
port = 389
proxyUser = uid=testproxy,ou=SpecialUsers,dc=testcanfar
proxyUser = uid=testuser,ou=testorg,dc=test
usersDN = usersDN
userRequestsDN = userRequestsDN
groupsDN = groupsDN
adminGroupsDN = adminGroupsDN
\ No newline at end of file
adminGroupsDN = adminGroupsDN
......@@ -32,8 +32,8 @@ unboundReadOnly.createIfNeeded = false
# server configuration -- applies to all servers
dbrcHost = devLdap
port = 389
proxyUser = uid=testproxy,ou=SpecialUsers,dc=testcanfar
proxyUser = uid=testuser,ou=testorg,dc=test
usersDN = usersDN
userRequestsDN = userRequestsDN
groupsDN = groupsDN
adminGroupsDN = adminGroupsDN
\ No newline at end of file
adminGroupsDN = adminGroupsDN
......@@ -95,12 +95,13 @@ public class LdapConfigTest
{
try
{
System.setProperty(PropertiesReader.class.getName() + ".dir", "test/config");
System.setProperty(PropertiesReader.class.getName() + ".dir", "src/test/config");
System.setProperty("user.home", "src/test/config");
LdapConfig c = LdapConfig.loadLdapConfig("testConfig1.properties");
Assert.assertEquals("devLdap", c.getDbrcHost());
Assert.assertEquals(389, c.getPort());
Assert.assertEquals("uid=testproxy,ou=SpecialUsers,dc=testcanfar", c.getProxyUserDN());
Assert.assertEquals("uid=testuser,ou=testorg,dc=test", c.getProxyUserDN());
Assert.assertEquals("usersDN", c.getUsersDN());
Assert.assertEquals("userRequestsDN", c.getUserRequestsDN());
Assert.assertEquals("groupsDN", c.getGroupsDN());
......@@ -138,12 +139,13 @@ public class LdapConfigTest
{
try
{
System.setProperty(PropertiesReader.class.getName() + ".dir", "test/config");
System.setProperty(PropertiesReader.class.getName() + ".dir", "src/test/config");
System.setProperty("user.home", "src/test/config");
LdapConfig c = LdapConfig.loadLdapConfig("testConfig2.properties");
Assert.assertEquals("devLdap", c.getDbrcHost());
Assert.assertEquals(389, c.getPort());
Assert.assertEquals("uid=testproxy,ou=SpecialUsers,dc=testcanfar", c.getProxyUserDN());
Assert.assertEquals("uid=testuser,ou=testorg,dc=test", c.getProxyUserDN());
Assert.assertEquals("usersDN", c.getUsersDN());
Assert.assertEquals("userRequestsDN", c.getUserRequestsDN());
Assert.assertEquals("groupsDN", c.getGroupsDN());
......@@ -181,7 +183,8 @@ public class LdapConfigTest
{
try
{
System.setProperty(PropertiesReader.class.getName() + ".dir", "test/config");
System.setProperty(PropertiesReader.class.getName() + ".dir", "src/test/config");
System.setProperty("user.home", "src/test/config");
LdapConfig c1 = LdapConfig.loadLdapConfig("testConfig1.properties");
LdapConfig c2 = LdapConfig.loadLdapConfig("testConfig1.properties");
......@@ -190,6 +193,7 @@ public class LdapConfigTest
catch (Throwable t)
{
log.error("Unexpected exception", t);
t.printStackTrace();
Assert.fail("Unexpected exception: " + t.getMessage());
}
finally
......@@ -203,7 +207,8 @@ public class LdapConfigTest
{
try
{
System.setProperty(PropertiesReader.class.getName() + ".dir", "test/config");
System.setProperty(PropertiesReader.class.getName() + ".dir", "src/test/config");
System.setProperty("user.home", "src/test/config");
LdapConfig c1 = LdapConfig.loadLdapConfig("testConfig2.properties");
LdapConfig c2 = LdapConfig.loadLdapConfig("testConfig2.properties");
......@@ -225,7 +230,8 @@ public class LdapConfigTest
{
try
{
System.setProperty(PropertiesReader.class.getName() + ".dir", "test/config");
System.setProperty(PropertiesReader.class.getName() + ".dir", "src/test/config");
System.setProperty("user.home", "src/test/config");
LdapConfig c1 = LdapConfig.loadLdapConfig("testConfig1.properties");
LdapConfig c2 = LdapConfig.loadLdapConfig("testConfig2.properties");
......@@ -247,7 +253,8 @@ public class LdapConfigTest
{
try
{
System.setProperty(PropertiesReader.class.getName() + ".dir", "test/config");
System.setProperty(PropertiesReader.class.getName() + ".dir", "src/test/config");
System.setProperty("user.home", "src/test/config");
LdapConfig ldapConfig = LdapConfig.loadLdapConfig("testConfig.read-only.properties");
......@@ -269,7 +276,8 @@ public class LdapConfigTest
{
try
{
System.setProperty(PropertiesReader.class.getName() + ".dir", "test/config");
System.setProperty(PropertiesReader.class.getName() + ".dir", "src/test/config");
System.setProperty("user.home", "src/test/config");
LdapConfig ldapConfig = LdapConfig.loadLdapConfig("testConfig.offline.properties");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment