use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.InstanceGroupV4Request in project cloudbreak by hortonworks.
the class SecurityAccessManifesterTest method overrideSecurityAccessWhenOneCidrRangeProvidedThenShouldUpdateTheCidrRange.
@Test
void overrideSecurityAccessWhenOneCidrRangeProvidedThenShouldUpdateTheCidrRange() {
InstanceGroupType gateway = GATEWAY;
List<InstanceGroupV4Request> instanceGroups = getInstanceGroups();
String theWholeWorld = "0.0.0.0/0";
securityAccessManifester.overrideSecurityAccess(gateway, instanceGroups, null, theWholeWorld);
assertEquals(1, instanceGroups.get(0).getSecurityGroup().getSecurityRules().size());
assertEquals(List.of(theWholeWorld), collectSubnets(instanceGroups));
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.InstanceGroupV4Request in project cloudbreak by hortonworks.
the class SecurityAccessManifesterTest method overrideSecurityAccessWhenMultipleCidrRangeProvidedThenShouldUpdateTheCidrRanges.
@Test
void overrideSecurityAccessWhenMultipleCidrRangeProvidedThenShouldUpdateTheCidrRanges() {
InstanceGroupType gateway = GATEWAY;
List<InstanceGroupV4Request> instanceGroups = getInstanceGroups();
String theWholeWorldAndASimpleCidr = "0.0.0.0/0,172.16.0.0/16";
securityAccessManifester.overrideSecurityAccess(gateway, instanceGroups, null, theWholeWorldAndASimpleCidr);
assertEquals(2, instanceGroups.get(0).getSecurityGroup().getSecurityRules().size());
assertEquals(List.of(theWholeWorldAndASimpleCidr.split(",")), collectSubnets(instanceGroups));
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.InstanceGroupV4Request in project cloudbreak by hortonworks.
the class MultiAzDecoratorTest method getInstanceGroupV4Request.
private InstanceGroupV4Request getInstanceGroupV4Request(InstanceGroupType instanceGroupType) {
InstanceGroupV4Request instanceGroup = new InstanceGroupV4Request();
instanceGroup.setType(instanceGroupType);
return instanceGroup;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.InstanceGroupV4Request in project cloudbreak by hortonworks.
the class StackRequestManifesterTest method setupInstanceVolumeEncryptionTestWhenAwsAndTwoInstanceGroupsAndEncryptionTypesNoneCustom.
@Test
void setupInstanceVolumeEncryptionTestWhenAwsAndTwoInstanceGroupsAndEncryptionTypesNoneCustom() {
DetailedEnvironmentResponse envResponse = new DetailedEnvironmentResponse();
envResponse.setCloudPlatform(CloudPlatform.AWS.name());
InstanceGroupV4Request instanceGroupV4Request1 = createInstanceGroupV4Request();
InstanceTemplateV4Request instanceTemplateV4Request1 = instanceGroupV4Request1.getTemplate();
instanceTemplateV4Request1.createAws().setEncryption(createAwsEncryptionV4Parameters(EncryptionType.NONE));
InstanceGroupV4Request instanceGroupV4Request2 = createInstanceGroupV4Request();
InstanceTemplateV4Request instanceTemplateV4Request2 = instanceGroupV4Request2.getTemplate();
instanceTemplateV4Request2.createAws().setEncryption(createAwsEncryptionV4Parameters(EncryptionType.CUSTOM, ENCRYPTION_KEY));
when(stackV4Request.getInstanceGroups()).thenReturn(List.of(instanceGroupV4Request1, instanceGroupV4Request2));
underTest.setupInstanceVolumeEncryption(stackV4Request, envResponse);
verifyAwsEncryption(instanceTemplateV4Request1, EncryptionType.NONE);
verifyAwsEncryption(instanceTemplateV4Request2, EncryptionType.CUSTOM, ENCRYPTION_KEY);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.InstanceGroupV4Request in project cloudbreak by hortonworks.
the class StackRequestManifesterTest method createInstanceGroupV4Request.
private InstanceGroupV4Request createInstanceGroupV4Request() {
InstanceGroupV4Request instanceGroupV4Request = new InstanceGroupV4Request();
instanceGroupV4Request.setTemplate(new InstanceTemplateV4Request());
return instanceGroupV4Request;
}
Aggregations