use of org.platformlayer.service.openldap.tests.OpenLdapTestHelpers in project platformlayer by platformlayer.
the class ITOpenLdapService method testCreateAndDeleteItem.
@Test
public void testCreateAndDeleteItem() throws Exception {
OpenLdapTestHelpers openLdap = new OpenLdapTestHelpers(getContext());
LdapService ldapService = openLdap.createLdapServer();
InetSocketAddress socketAddress = getUniqueEndpoint(ldapService);
Assert.assertFalse(isPortOpen(socketAddress));
openFirewall(ldapService, LdapServiceController.PORT);
Assert.assertTrue(isPortOpen(socketAddress));
String organizationName = "test.platformlayer.org";
LdapDomain ldapDomain = openLdap.createLdapDomain(ldapService, organizationName);
// TODO: Make endpoint ldap://<ip>:<port>/ ???
String ldapUrl = "ldap://" + socketAddress.getAddress().getHostAddress() + ":" + socketAddress.getPort() + "/";
testLdap(ldapUrl, ldapDomain.adminPassword);
}
use of org.platformlayer.service.openldap.tests.OpenLdapTestHelpers in project platformlayer by platformlayer.
the class ITGitService method testCreateAndDeleteItem.
@Test
public void testCreateAndDeleteItem() throws Exception {
OpenLdapTestHelpers openLdap = new OpenLdapTestHelpers(getContext());
LdapService ldapService = openLdap.createLdapServer();
openFirewall(ldapService, LdapServiceController.PORT);
String organizationName = "test.platformlayer.org";
LdapDomain ldapDomain = openLdap.createLdapDomain(ldapService, organizationName);
String id = "git" + random.randomAlphanumericString(8);
GitService service = new GitService();
service.dnsName = id + ".test.platformlayer.org";
service.ldapGroup = "ou=Git Users,dc=test,dc=platformlayer,dc=org";
service = putItem(id, service);
service = waitForHealthy(service);
InetSocketAddress socketAddress = getUniqueEndpoint(service);
Assert.assertFalse(isPortOpen(socketAddress));
openFirewall(service, GitServerController.PORT);
Assert.assertTrue(isPortOpen(socketAddress));
String repoId = "repo" + id;
GitRepository repo = new GitRepository();
repo.name = repoId;
repo = putItem(repoId, repo);
repo = waitForHealthy(repo);
// TODO: Make endpoint http://<ip>:<port>/<path>...
String url = "http://" + socketAddress.getAddress().getHostAddress() + ":" + socketAddress.getPort() + "/git/" + repoId;
String username = null;
String password = null;
testGitRepo(url, username, password);
}
Aggregations