use of com.sequenceiq.it.cloudbreak.dto.sdx.SdxTestDto in project cloudbreak by hortonworks.
the class TagsUtilTest method addTestNameTagShouldAddTagToAbstractTestDtoWithTaggableRequest.
@Test
void addTestNameTagShouldAddTagToAbstractTestDtoWithTaggableRequest() {
SdxTestDto testDto = new SdxTestDto(mock(TestContext.class));
SdxClusterRequest request = new SdxClusterRequest();
testDto.setRequest(request);
when(testContext.getCloudPlatform()).thenReturn(CloudPlatform.MOCK);
underTest.addTestNameTag(testContext.getCloudPlatform(), testDto, TEST_NAME);
assertThat(request.getTags().get(TagsUtil.TEST_NAME_TAG)).isEqualTo(TEST_NAME);
}
use of com.sequenceiq.it.cloudbreak.dto.sdx.SdxTestDto in project cloudbreak by hortonworks.
the class SdxRepairTests method testSDXRepairMasterAndIDBRokerWithStoppedEC2Instance.
@Test(dataProvider = TEST_CONTEXT)
@Description(given = "there is a running Cloudbreak, and an SDX cluster in available state", when = "recovery called on the MASTER and then the IDBROKER host group, where the EC2 instance had been stopped", then = "SDX recovery should be successful, the cluster should be up and running")
public void testSDXRepairMasterAndIDBRokerWithStoppedEC2Instance(TestContext testContext) {
String sdx = resourcePropertyProvider().getName();
DescribeFreeIpaResponse describeFreeIpaResponse = testContext.given(FreeIpaTestDto.class).when(freeIpaTestClient.describe()).getResponse();
SdxTestDto sdxTestDto = testContext.given(sdx, SdxTestDto.class).withCloudStorage(getCloudStorageRequest(testContext)).when(sdxTestClient.create(), key(sdx)).await(SdxClusterStatusResponse.RUNNING, key(sdx)).awaitForHealthyInstances();
repair(sdxTestDto, sdx, MASTER.getName(), Set.of(SdxClusterStatusResponse.CLUSTER_UNREACHABLE));
repair(sdxTestDto, sdx, IDBROKER.getName(), Set.of(SdxClusterStatusResponse.NODE_FAILURE));
sdxTestDto.then((tc, testDto, client) -> {
getCloudFunctionality(tc).cloudStorageListContainerDataLake(getBaseLocation(testDto), testDto.getResponse().getName(), testDto.getResponse().getStackCrn());
return testDto;
}).then((tc, testDto, client) -> {
getCloudFunctionality(tc).cloudStorageListContainerFreeIpa(getBaseLocation(testDto), describeFreeIpaResponse.getName(), describeFreeIpaResponse.getCrn());
return testDto;
}).validate();
}
use of com.sequenceiq.it.cloudbreak.dto.sdx.SdxTestDto in project cloudbreak by hortonworks.
the class FreeIpaUpgradeTests method dnsLookups.
private void dnsLookups(SdxTestDto sdxTestDto, SdxClient sdxClient) {
InstanceMetaDataV4Response instanceGroupMetadata = getInstanceGroups(sdxTestDto, sdxClient).stream().flatMap(instanceGroup -> instanceGroup.getMetadata().stream()).filter(metadata -> metadata.getInstanceGroup().equals("idbroker")).filter(metadata -> StringUtils.isNoneBlank(metadata.getDiscoveryFQDN(), metadata.getPrivateIp())).findFirst().orElseThrow(() -> new TestFailException("FreeIPA upgrade DNS lookups test failed, idbroker instance group was not found."));
try {
String cmd = String.format(CHECK_DNS_LOOKUPS_CMD, instanceGroupMetadata.getDiscoveryFQDN(), instanceGroupMetadata.getPrivateIp());
Map<String, Pair<Integer, String>> results = sshJClientActions.executeSshCommandOnHost(getInstanceGroups(sdxTestDto, sdxClient), List.of(HostGroupType.MASTER.getName()), cmd, false);
results.values().forEach(result -> Assertions.assertEquals(0, result.getLeft()));
} catch (Exception e) {
logger.error("FreeIPA upgrade DNS lookups test failed with unexpected error", e);
throw new TestFailException("FreeIPA upgrade DNS lookups test failed with unexpected error: " + e.getMessage(), e);
}
}
Aggregations