use of com.sequenceiq.it.cloudbreak.exception.TestFailException in project cloudbreak by hortonworks.
the class FreeIpaUpgradeTests method generateHostKeyTab.
private void generateHostKeyTab(com.sequenceiq.freeipa.api.client.FreeIpaClient ipaClient, String environmentCrn) {
try {
HostKeytabRequest hostKeytabRequest = new HostKeytabRequest();
hostKeytabRequest.setEnvironmentCrn(environmentCrn);
hostKeytabRequest.setServerHostName("test.local");
hostKeytabRequest.setDoNotRecreateKeytab(Boolean.FALSE);
ipaClient.getKerberosMgmtV1Endpoint().generateHostKeytab(hostKeytabRequest);
} catch (Exception e) {
logger.error("Generate Host keytab test failed during upgrade", e);
throw new TestFailException("Generate Host keytab test failed during upgrade with: " + e.getMessage(), e);
}
}
use of com.sequenceiq.it.cloudbreak.exception.TestFailException in project cloudbreak by hortonworks.
the class FreeIpaUpgradeTests method cleanUp.
private void cleanUp(TestContext testContext, com.sequenceiq.freeipa.api.client.FreeIpaClient ipaClient, String environmentCrn) {
try {
CleanupRequest cleanupRequest = new CleanupRequest();
cleanupRequest.setEnvironmentCrn(environmentCrn);
cleanupRequest.setClusterName("testuser");
cleanupRequest.setUsers(Set.of("kerberosbind-testuser", "ldapbind-testuser"));
OperationStatus operationStatus = ipaClient.getFreeIpaV1Endpoint().cleanup(cleanupRequest);
waitToCompleted(testContext, operationStatus.getOperationId(), "cleanupOperation");
} catch (Exception e) {
logger.error("CLEANUP test failed during upgrade", e);
// throw new TestFailException("CLEANUP test failed during upgrade with: " + e.getMessage(), e);
}
}
use of com.sequenceiq.it.cloudbreak.exception.TestFailException in project cloudbreak by hortonworks.
the class FreeIpaUpgradeTests method addListDeleteDnsZonesBySubnet.
private void addListDeleteDnsZonesBySubnet(com.sequenceiq.freeipa.api.client.FreeIpaClient ipaClient, String environmentCrn) {
try {
AddDnsZoneForSubnetsRequest request = new AddDnsZoneForSubnetsRequest();
request.setSubnets(List.of("10.0.1.0/24", "192.168.1.0/24"));
request.setEnvironmentCrn(environmentCrn);
ipaClient.getDnsV1Endpoint().addDnsZoneForSubnets(request);
/* Until CB-15454 is fixed
Set<String> dnsZones = ipaClient.getDnsV1Endpoint().listDnsZones(environmentCrn);
Assertions.assertTrue(dnsZones.stream().anyMatch(dnsZone -> dnsZone.startsWith("1.0.10")));
Assertions.assertTrue(dnsZones.stream().anyMatch(dnsZone -> dnsZone.startsWith("1.168.192")));*/
ipaClient.getDnsV1Endpoint().deleteDnsZoneBySubnet(environmentCrn, "192.168.1.0/24");
ipaClient.getDnsV1Endpoint().deleteDnsZoneBySubnet(environmentCrn, "10.0.1.0/24");
/* dnsZones = ipaClient.getDnsV1Endpoint().listDnsZones(environmentCrn);
Assertions.assertFalse(dnsZones.stream().anyMatch(dnsZone -> dnsZone.startsWith("1.0.10")));
Assertions.assertFalse(dnsZones.stream().anyMatch(dnsZone -> dnsZone.startsWith("1.168.192")));*/
} catch (Exception e) {
logger.error("DNS ZONE test failed during upgrade", e);
throw new TestFailException("DNS ZONE test failed during upgrade with: " + e.getMessage(), e);
}
}
use of com.sequenceiq.it.cloudbreak.exception.TestFailException in project cloudbreak by hortonworks.
the class DistroXResilientScaleTests method removeInstanceWhileScalingGroup.
private DistroXTestDto removeInstanceWhileScalingGroup(TestContext testContext, DistroXTestDto testDto, CloudbreakClient client, DistroXScaleTestParameters params) {
CloudFunctionality cloudFunctionality = testContext.getCloudProvider().getCloudFunctionality();
List<String> instancesToDelete = distroxUtil.getInstanceIds(testDto, client, params.getHostGroup()).stream().limit(getDeletionLimit(params)).collect(Collectors.toList());
if (instancesToDelete.isEmpty()) {
throw new TestFailException(String.format("At least 1 instance needed from '%s' group to delete!", params.getHostGroup()));
}
cloudFunctionality.deleteInstances(testDto.getName(), instancesToDelete);
return testDto;
}
use of com.sequenceiq.it.cloudbreak.exception.TestFailException in project cloudbreak by hortonworks.
the class SdxBackupRestoreTest method validateDatalakeBackupStatus.
private SdxInternalTestDto validateDatalakeBackupStatus(TestContext testContext, SdxInternalTestDto testDto, SdxClient client) {
String sdxName = testDto.getName();
backupId = client.getDefaultClient().sdxBackupEndpoint().getDatalakeBackupId(sdxName, null);
SdxBackupStatusResponse sdxBackupStatusResponse = client.getDefaultClient().sdxBackupEndpoint().getBackupDatalakeStatus(sdxName, backupId, null);
String status = sdxBackupStatusResponse.getStatus();
String statusReason = sdxBackupStatusResponse.getReason();
LOGGER.info(format(" SDX '%s' backup '%s' status '%s', because of %s ", sdxName, backupId, status, statusReason));
if (status.contains("FAILED")) {
LOGGER.error(String.format(" Sdx '%s' backup has been failed: '%s' ", testDto.getName(), statusReason));
throw new TestFailException(String.format(" Sdx '%s' backup has been failed: '%s' ", testDto.getName(), statusReason));
} else {
LOGGER.info(String.format(" Sdx '%s' backup has been done with '%s'. ", testDto.getName(), statusReason));
Log.then(LOGGER, format(" Sdx '%s' backup has been done with '%s'. ", testDto.getName(), statusReason));
}
return testDto;
}
Aggregations