Search in sources :

Example 1 with InstanceGroupV2Request

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());
}
Also used : IntegrationTestContext(com.sequenceiq.it.IntegrationTestContext) InstanceGroupV2Request(com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request) BeforeClass(org.testng.annotations.BeforeClass) Parameters(org.testng.annotations.Parameters)

Example 2 with InstanceGroupV2Request

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());
}
Also used : IntegrationTestContext(com.sequenceiq.it.IntegrationTestContext) InstanceGroupV2Request(com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request) BeforeClass(org.testng.annotations.BeforeClass) Parameters(org.testng.annotations.Parameters)

Example 3 with InstanceGroupV2Request

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());
}
Also used : IntegrationTestContext(com.sequenceiq.it.IntegrationTestContext) InstanceGroupV2Request(com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request) BeforeClass(org.testng.annotations.BeforeClass) Parameters(org.testng.annotations.Parameters)

Example 4 with InstanceGroupV2Request

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;
}
Also used : InstanceGroupV2Request(com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request) SecurityGroupV2Request(com.sequenceiq.cloudbreak.api.model.v2.SecurityGroupV2Request)

Example 5 with InstanceGroupV2Request

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;
}
Also used : InstanceGroupV2Request(com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request) SecurityGroupV2Request(com.sequenceiq.cloudbreak.api.model.v2.SecurityGroupV2Request)

Aggregations

InstanceGroupV2Request (com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request)22 SecurityGroupV2Request (com.sequenceiq.cloudbreak.api.model.v2.SecurityGroupV2Request)9 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)9 Parameters (org.testng.annotations.Parameters)9 BeforeClass (org.testng.annotations.BeforeClass)5 BeforeMethod (org.testng.annotations.BeforeMethod)4 TemplateV2Request (com.sequenceiq.cloudbreak.api.model.v2.TemplateV2Request)3 HostGroupRequest (com.sequenceiq.cloudbreak.api.model.HostGroupRequest)2 StackV2Request (com.sequenceiq.cloudbreak.api.model.v2.StackV2Request)2 ClusterRequest (com.sequenceiq.cloudbreak.api.model.ClusterRequest)1 ConstraintJson (com.sequenceiq.cloudbreak.api.model.ConstraintJson)1 InstanceGroupRequest (com.sequenceiq.cloudbreak.api.model.InstanceGroupRequest)1 NetworkRequest (com.sequenceiq.cloudbreak.api.model.NetworkRequest)1 OrchestratorRequest (com.sequenceiq.cloudbreak.api.model.OrchestratorRequest)1 SecurityRuleRequest (com.sequenceiq.cloudbreak.api.model.SecurityRuleRequest)1 StackAuthenticationRequest (com.sequenceiq.cloudbreak.api.model.StackAuthenticationRequest)1 StackRequest (com.sequenceiq.cloudbreak.api.model.StackRequest)1 UpdateClusterJson (com.sequenceiq.cloudbreak.api.model.UpdateClusterJson)1 ClusterV2Request (com.sequenceiq.cloudbreak.api.model.v2.ClusterV2Request)1 GeneralSettings (com.sequenceiq.cloudbreak.api.model.v2.GeneralSettings)1