use of com.sequenceiq.cloudbreak.common.orchestration.Node in project cloudbreak by hortonworks.
the class OrchestratorRecipeExecutorTest method postClusterManagerStartRecipesShouldUseReachableNodes.
@Test
public void postClusterManagerStartRecipesShouldUseReachableNodes() throws CloudbreakException, CloudbreakOrchestratorFailedException, CloudbreakOrchestratorTimeoutException {
when(stack.getId()).thenReturn(1L);
Cluster cluster = new Cluster();
cluster.setId(2L);
when(stack.getCluster()).thenReturn(cluster);
when(gatewayConfigService.getPrimaryGatewayConfig(any())).thenReturn(gatewayConfig);
Set<Node> nodes = Set.of(this.node);
when(stackUtil.collectReachableNodes(any())).thenReturn(nodes);
underTest.postClusterManagerStartRecipes(stack);
verify(gatewayConfigService).getPrimaryGatewayConfig(stack);
verify(stackUtil).collectReachableNodes(stack);
verify(hostOrchestrator).postClusterManagerStartRecipes(eq(gatewayConfig), eq(nodes), any());
}
use of com.sequenceiq.cloudbreak.common.orchestration.Node in project cloudbreak by hortonworks.
the class OrchestratorRecipeExecutorTest method postClusterInstallShouldUseReachableNodes.
@Test
public void postClusterInstallShouldUseReachableNodes() throws CloudbreakException, CloudbreakOrchestratorFailedException, CloudbreakOrchestratorTimeoutException {
when(stack.getId()).thenReturn(1L);
Cluster cluster = new Cluster();
cluster.setId(2L);
when(stack.getCluster()).thenReturn(cluster);
when(gatewayConfigService.getPrimaryGatewayConfig(any())).thenReturn(gatewayConfig);
Set<Node> nodes = Set.of(this.node);
when(stackUtil.collectReachableNodes(any())).thenReturn(nodes);
underTest.postClusterInstall(stack);
verify(gatewayConfigService).getPrimaryGatewayConfig(stack);
verify(stackUtil).collectReachableNodes(stack);
verify(hostOrchestrator).postInstallRecipes(eq(gatewayConfig), eq(nodes), any());
}
use of com.sequenceiq.cloudbreak.common.orchestration.Node in project cloudbreak by hortonworks.
the class OrchestratorRecipeExecutorTest method testPreTerminationRecipes.
@Test
public void testPreTerminationRecipes() throws CloudbreakException, CloudbreakOrchestratorFailedException, CloudbreakOrchestratorTimeoutException {
when(gatewayConfigService.getPrimaryGatewayConfig(any())).thenReturn(gatewayConfig);
Set<Node> nodes = Set.of(node);
when(stackUtil.collectReachableNodes(any())).thenReturn(nodes);
underTest.preTerminationRecipes(stack, false);
verify(hostOrchestrator).preTerminationRecipes(eq(gatewayConfig), eq(Set.of(node)), exitCriteriaModelCaptor.capture(), eq(false));
ExitCriteriaModel exitCriteriaModel = exitCriteriaModelCaptor.getValue();
assertThat(exitCriteriaModel).isOfAnyClassIn(ClusterDeletionBasedExitCriteriaModel.class);
}
use of com.sequenceiq.cloudbreak.common.orchestration.Node in project cloudbreak by hortonworks.
the class FreeIpaNodeUtilServiceTest method testMapInstancesToNodesConvertsInstanceWithPrivateIp.
@Test
public void testMapInstancesToNodesConvertsInstanceWithPrivateIp() {
Set<Node> nodes = underTest.mapInstancesToNodes(Set.of(im));
assertEquals(1, nodes.size());
Node node = nodes.iterator().next();
assertEquals(PRIVATE_IP, node.getPrivateIp());
assertEquals(PRIVATE_IP, node.getPublicIp());
assertEquals(INSTANCE_ID, node.getInstanceId());
assertEquals(INSTANCE_TYPE, node.getInstanceType());
assertEquals(FQDN, node.getHostname());
assertEquals(GROUP_NAME, node.getHostGroup());
}
use of com.sequenceiq.cloudbreak.common.orchestration.Node in project cloudbreak by hortonworks.
the class FreeIpaNodeUtilServiceTest method testMapInstancesToNodesConvertsInstanceWithPublicIp.
@Test
public void testMapInstancesToNodesConvertsInstanceWithPublicIp() {
im.setPublicIp(PUBLIC_IP);
Set<Node> nodes = underTest.mapInstancesToNodes(Set.of(im));
assertEquals(1, nodes.size());
Node node = nodes.iterator().next();
assertEquals(PRIVATE_IP, node.getPrivateIp());
assertEquals(PUBLIC_IP, node.getPublicIp());
assertEquals(INSTANCE_ID, node.getInstanceId());
assertEquals(INSTANCE_TYPE, node.getInstanceType());
assertEquals(FQDN, node.getHostname());
assertEquals(GROUP_NAME, node.getHostGroup());
}
Aggregations