use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class SdxRangerRazEnabledTests method testCreateSdxWithoutRangerRaz.
@Test(dataProvider = TEST_CONTEXT)
@Description(given = "there is a running Cloudbreak", when = "enableRangerRaz is called when Raz is not installed", then = "Exception is thrown")
public void testCreateSdxWithoutRangerRaz(TestContext testContext) {
String sdx = resourcePropertyProvider().getName();
SdxDatabaseRequest sdxDatabaseRequest = new SdxDatabaseRequest();
sdxDatabaseRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
testContext.given(SdxTestDto.class).withExternalDatabase(sdxDatabaseRequest).withCloudStorage(getCloudStorageRequest(testContext)).when(sdxTestClient.create(), key(sdx)).await(SdxClusterStatusResponse.RUNNING).awaitForHealthyInstances().whenException(sdxTestClient.enableRangerRaz(), BadRequestException.class).validate();
}
use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class SdxSecurityTests method testSDXAutoTlsCertRotation.
@Test(dataProvider = TEST_CONTEXT)
@UseSpotInstances
@Description(given = "there is a running Cloudbreak, and an SDX cluster in available state", when = "autotls cert rotation is called on the SDX cluster", then = "host certificates' validity should be changed on all hosts, the cluster should be up and running")
public void testSDXAutoTlsCertRotation(TestContext testContext) {
String sdx = resourcePropertyProvider().getName();
List<String> originalCertValidityOutput = new ArrayList<>();
List<String> renewedCertValidityOutput = new ArrayList<>();
SdxDatabaseRequest noDatabaseRequest = new SdxDatabaseRequest();
noDatabaseRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
testContext.given(sdx, SdxTestDto.class).withCloudStorage().withExternalDatabase(noDatabaseRequest).when(sdxTestClient.create(), key(sdx)).await(SdxClusterStatusResponse.RUNNING, key(sdx)).awaitForHealthyInstances().then((tc, testDto, client) -> {
Map<String, Pair<Integer, String>> certValidityCmdResultByIpsMap = sshJClientActions.executeSshCommandOnHost(getInstanceGroups(testDto, client), List.of(HostGroupType.MASTER.getName(), HostGroupType.IDBROKER.getName()), HOST_CERT_VALIDITY_CMD, false);
originalCertValidityOutput.addAll(certValidityCmdResultByIpsMap.values().stream().map(Pair::getValue).collect(Collectors.toList()));
return testDto;
}).when(sdxTestClient.rotateAutotlsCertificates(), key(sdx)).await(SdxClusterStatusResponse.CERT_ROTATION_IN_PROGRESS, key(sdx).withWaitForFlow(false)).await(SdxClusterStatusResponse.RUNNING, key(sdx)).awaitForHealthyInstances().then((tc, testDto, client) -> {
Map<String, Pair<Integer, String>> certValidityCmdResultByIpsMap = sshJClientActions.executeSshCommandOnHost(getInstanceGroups(testDto, client), List.of(HostGroupType.MASTER.getName(), HostGroupType.IDBROKER.getName()), HOST_CERT_VALIDITY_CMD, false);
renewedCertValidityOutput.addAll(certValidityCmdResultByIpsMap.entrySet().stream().map(e -> e.getValue().getValue()).collect(Collectors.toList()));
return testDto;
}).then((tc, testDto, client) -> compareCertValidityOutputs(testDto, originalCertValidityOutput, renewedCertValidityOutput)).validate();
}
use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class DistroXClusterCreationTest method sdxDatabaseRequestWithCreateTrue.
private SdxDatabaseRequest sdxDatabaseRequestWithCreateTrue() {
SdxDatabaseRequest dbRequest = new SdxDatabaseRequest();
dbRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NON_HA);
return dbRequest;
}
use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class SdxExternalDatabaseConfigurerTest method whenPlatformIsAzureWithoutRuntimeVerionSet.
@Test
public void whenPlatformIsAzureWithoutRuntimeVerionSet() {
CloudPlatform cloudPlatform = CloudPlatform.AZURE;
when(platformConfig.isExternalDatabaseSupportedFor(cloudPlatform)).thenReturn(true);
when(platformConfig.isExternalDatabaseSupportedOrExperimental(CloudPlatform.AZURE)).thenReturn(true);
SdxDatabaseRequest dbRequest = new SdxDatabaseRequest();
SdxCluster sdxCluster = new SdxCluster();
sdxCluster.setClusterName("clusterName");
underTest.configure(cloudPlatform, dbRequest, sdxCluster);
assertEquals(true, sdxCluster.isCreateDatabase());
assertEquals(SdxDatabaseAvailabilityType.HA, sdxCluster.getDatabaseAvailabilityType());
}
use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class SdxExternalDatabaseConfigurerTest method whenPlatformIsAwsWithSkipCreateShouldNotCreateDatabase.
@Test
public void whenPlatformIsAwsWithSkipCreateShouldNotCreateDatabase() {
CloudPlatform cloudPlatform = CloudPlatform.AWS;
SdxDatabaseRequest dbRequest = new SdxDatabaseRequest();
dbRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
SdxCluster sdxCluster = new SdxCluster();
underTest.configure(cloudPlatform, dbRequest, sdxCluster);
assertEquals(false, sdxCluster.isCreateDatabase());
assertEquals(SdxDatabaseAvailabilityType.NONE, sdxCluster.getDatabaseAvailabilityType());
}
Aggregations