use of org.keycloak.testsuite.arquillian.ContainerInfo in project keycloak by keycloak.
the class AbstractAdapterClusteredTest method startServers.
@Before
public void startServers() throws Exception {
prepareServerDirectories();
for (ContainerInfo containerInfo : testContext.getAppServerBackendsInfo()) {
controller.start(containerInfo.getQualifier());
}
deploy();
}
use of org.keycloak.testsuite.arquillian.ContainerInfo in project keycloak by keycloak.
the class InfinispanTestTimeServiceRule method before.
@Override
protected void before() throws Throwable {
if (!this.test.getTestContext().getSuiteContext().isAuthServerCrossDc()) {
// No cross-dc environment
test.getTestingClient().testing().setTestingInfinispanTimeService();
} else {
AtomicInteger count = new AtomicInteger(0);
// Cross-dc environment - Set on all started nodes
forAllBackendNodesStream().filter(ContainerInfo::isStarted).map(CrossDCTestEnricher.getBackendTestingClients()::get).forEach(testingClient -> {
testingClient.testing().setTestingInfinispanTimeService();
count.incrementAndGet();
});
//
log.infof("Totally set infinispanTimeService rule in %d servers", count.get());
}
}
use of org.keycloak.testsuite.arquillian.ContainerInfo in project keycloak by keycloak.
the class AbstractSAMLAdapterClusteredTest method testNodeRestartResiliency.
@Test
public void testNodeRestartResiliency(@ArquillianResource @OperateOnDeployment(value = EmployeeServletDistributable.DEPLOYMENT_NAME) URL employeeUrl) throws Exception {
ContainerInfo containerInfo = testContext.getAppServerBackendsInfo().get(0);
setPasswordFor(bburkeUser, CredentialRepresentation.PASSWORD);
String employeeUrlString = getProxiedUrl(employeeUrl);
SamlClient samlClient = new SamlClientBuilder().navigateTo(employeeUrlString).processSamlResponse(Binding.POST).build().login().user(bburkeUser).build().processSamlResponse(Binding.POST).build().assertResponse(Matchers.bodyHC(containsString("principal=bburke"))).execute();
controller.stop(containerInfo.getQualifier());
// Update the proxy to forward to the second node.
updateProxy(NODE_2_NAME, NODE_2_URI, NODE_1_URI);
samlClient.execute(new SamlClientBuilder().navigateTo(employeeUrlString).doNotFollowRedirects().assertResponse(Matchers.bodyHC(containsString("principal=bburke"))).getSteps());
controller.start(containerInfo.getQualifier());
// Update the proxy to forward to the first node.
updateProxy(NODE_1_NAME, NODE_1_URI, NODE_2_URI);
samlClient.execute(new SamlClientBuilder().navigateTo(employeeUrlString).doNotFollowRedirects().assertResponse(Matchers.bodyHC(containsString("principal=bburke"))).getSteps());
}
use of org.keycloak.testsuite.arquillian.ContainerInfo in project keycloak by keycloak.
the class AbstractCrossDCTest method enableLoadBalancerNode.
/**
* Enables routing requests to the given node within the given data center in the load balancer.
* @param dc
* @param nodeIndex
*/
public void enableLoadBalancerNode(DC dc, int nodeIndex) {
int dcIndex = dc.ordinal();
log.infof("--DC: Enabling load balancer for dc=%d, node=%d", dcIndex, nodeIndex);
final ContainerInfo backendNode = this.suiteContext.getDcAuthServerBackendsInfo().get(dcIndex).get(nodeIndex);
if (backendNode == null) {
throw new IllegalArgumentException("Invalid node with index " + nodeIndex + " for DC " + dcIndex);
}
if (!backendNode.isStarted()) {
log.warnf("--DC: Node %s is not started in DC %d", backendNode.getQualifier(), dcIndex);
}
loadBalancerCtrl.enableBackendNodeByName(backendNode.getQualifier());
}
use of org.keycloak.testsuite.arquillian.ContainerInfo in project keycloak by keycloak.
the class AbstractClusterTest method logFailoverSetup.
protected void logFailoverSetup() {
log.info("Current failover setup");
boolean started = controller.isStarted(getCurrentFailNode().getQualifier());
log.info("Fail node: " + getCurrentFailNode() + (started ? "" : " (stopped)"));
for (ContainerInfo survivor : getCurrentSurvivorNodes()) {
started = controller.isStarted(survivor.getQualifier());
log.info("Survivor: " + survivor + (started ? "" : " (stopped)"));
}
}
Aggregations