use of com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request in project cloudbreak by hortonworks.
the class MockStackCreationV2Test method configMockServer.
@BeforeClass
@Parameters({ "stackName", "mockPort", "sshPort" })
public void configMockServer(String stackName, @Optional("9443") int mockPort, @Optional("2020") int sshPort) {
IntegrationTestContext itContext = getItContext();
Map<String, InstanceGroupV2Request> instanceGroupV2RequestMap = itContext.getContextParam(CloudbreakV2Constants.INSTANCEGROUP_MAP, Map.class);
int numberOfServers = 0;
for (InstanceGroupV2Request igr : instanceGroupV2RequestMap.values()) {
numberOfServers += igr.getNodeCount();
}
StackCreationMock stackCreationMock = (StackCreationMock) applicationContext.getBean(StackCreationMock.NAME, mockPort, sshPort, numberOfServers);
stackCreationMock.addSPIEndpoints();
stackCreationMock.mockImageCatalogResponse(itContext);
stackCreationMock.addSaltMappings();
stackCreationMock.addAmbariMappings(stackName);
itContext.putContextParam(CloudbreakV2Constants.MOCK_SERVER, stackCreationMock);
itContext.putContextParam(CloudbreakITContextConstants.MOCK_INSTANCE_MAP, stackCreationMock.getInstanceMap());
}
use of com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request in project cloudbreak by hortonworks.
the class MockInstanceTerminationReplicationErrorTest method configMockServer.
@BeforeClass
@Parameters({ "mockPort", "sshPort" })
public void configMockServer(@Optional("9443") int mockPort, @Optional("2020") int sshPort) {
IntegrationTestContext itContext = getItContext();
Map<String, InstanceGroupV2Request> instanceGroupV2RequestMap = itContext.getContextParam(CloudbreakV2Constants.INSTANCEGROUP_MAP, Map.class);
String stackName = itContext.getContextParam(CloudbreakV2Constants.STACK_NAME);
int numberOfServers = 0;
for (InstanceGroupV2Request igr : instanceGroupV2RequestMap.values()) {
numberOfServers += igr.getNodeCount();
}
InstanceTerminationReplicationErrorMock instanceTerminationMock = (InstanceTerminationReplicationErrorMock) applicationContext.getBean(InstanceTerminationReplicationErrorMock.NAME, mockPort, sshPort, numberOfServers);
instanceTerminationMock.addAmbariMappings(stackName);
instanceTerminationMock.addMockEndpoints();
itContext.putContextParam(CloudbreakV2Constants.MOCK_SERVER, instanceTerminationMock);
itContext.putContextParam(CloudbreakITContextConstants.MOCK_INSTANCE_MAP, instanceTerminationMock.getInstanceMap());
}
use of com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request in project cloudbreak by hortonworks.
the class MockInstanceTerminationTest method configMockServer.
@BeforeClass
@Parameters({ "mockPort", "sshPort" })
public void configMockServer(@Optional("9443") int mockPort, @Optional("2020") int sshPort) {
IntegrationTestContext itContext = getItContext();
Map<String, InstanceGroupV2Request> instanceGroupV2RequestMap = itContext.getContextParam(CloudbreakV2Constants.INSTANCEGROUP_MAP, Map.class);
String stackName = itContext.getContextParam(CloudbreakV2Constants.STACK_NAME);
int numberOfServers = 0;
for (InstanceGroupV2Request igr : instanceGroupV2RequestMap.values()) {
numberOfServers += igr.getNodeCount();
}
InstanceTerminationMock instanceTerminationMock = (InstanceTerminationMock) applicationContext.getBean(InstanceTerminationMock.NAME, mockPort, sshPort, numberOfServers);
instanceTerminationMock.addAmbariMappings(stackName);
instanceTerminationMock.addMockEndpoints();
itContext.putContextParam(CloudbreakV2Constants.MOCK_SERVER, instanceTerminationMock);
itContext.putContextParam(CloudbreakITContextConstants.MOCK_INSTANCE_MAP, instanceTerminationMock.getInstanceMap());
}
use of com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request in project cloudbreak by hortonworks.
the class CloudProviderHelper method master.
InstanceGroupV2Request master() {
InstanceGroupV2Request r = new InstanceGroupV2Request();
r.setNodeCount(1);
r.setGroup("master");
r.setType(InstanceGroupType.GATEWAY);
SecurityGroupV2Request s = new SecurityGroupV2Request();
s.setSecurityRules(rules());
r.setSecurityGroup(s);
r.setTemplate(template());
return r;
}
use of com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request in project cloudbreak by hortonworks.
the class CloudProviderHelper method master.
public InstanceGroupV2Request master(String securityGroupId) {
InstanceGroupV2Request r = new InstanceGroupV2Request();
r.setNodeCount(1);
r.setGroup("master");
r.setType(InstanceGroupType.GATEWAY);
SecurityGroupV2Request s = new SecurityGroupV2Request();
s.setSecurityGroupId(securityGroupId);
r.setSecurityGroup(s);
r.setTemplate(template());
return r;
}
Aggregations