Search in sources :

Example 1 with AbsolutTimeBasedTimeoutChecker

use of com.sequenceiq.cloudbreak.polling.AbsolutTimeBasedTimeoutChecker in project cloudbreak by hortonworks.

the class FreeIpaUpgradeTests method testHAFreeIpaInstanceUpgrade.

@Test(dataProvider = TEST_CONTEXT)
@Description(given = "there is a running cloudbreak", when = "a valid stack create request is sent with 3 FreeIPA instances " + "AND the stack is upgraded one node at a time", then = "the stack should be available AND deletable")
public void testHAFreeIpaInstanceUpgrade(TestContext testContext) {
    String freeIpa = resourcePropertyProvider().getName();
    SdxDatabaseRequest sdxDatabaseRequest = new SdxDatabaseRequest();
    sdxDatabaseRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
    sdxDatabaseRequest.setCreate(false);
    testContext.given("telemetry", TelemetryTestDto.class).withLogging().withReportClusterLogs().given(freeIpa, FreeIpaTestDto.class).withFreeIpaHa(1, 3).withTelemetry("telemetry").withUpgradeCatalogAndImage().when(freeIpaTestClient.create(), key(freeIpa)).await(FREEIPA_AVAILABLE).given(SdxTestDto.class).withCloudStorage().withExternalDatabase(sdxDatabaseRequest).when(sdxTestClient.create()).await(SdxClusterStatusResponse.RUNNING).given(freeIpa, FreeIpaTestDto.class).when(freeIpaTestClient.upgrade()).await(Status.UPDATE_IN_PROGRESS, waitForFlow().withWaitForFlow(Boolean.FALSE)).given(FreeIpaOperationStatusTestDto.class).withOperationId(((FreeIpaTestDto) testContext.get(freeIpa)).getOperationId()).then((tc, testDto, freeIpaClient) -> testFreeIpaAvailabilityDuringUpgrade(tc, testDto, freeIpaClient, freeIpa)).await(COMPLETED, waitForFlow().withWaitForFlow(Boolean.FALSE).withTimeoutChecker(new AbsolutTimeBasedTimeoutChecker(TWO_HOURS_IN_SEC))).given(freeIpa, FreeIpaTestDto.class).await(FREEIPA_AVAILABLE, waitForFlow().withWaitForFlow(Boolean.FALSE)).then((tc, testDto, client) -> freeIpaTestClient.delete().action(tc, testDto, client)).await(FREEIPA_DELETE_COMPLETED, waitForFlow().withWaitForFlow(Boolean.FALSE)).validate();
}
Also used : AbsolutTimeBasedTimeoutChecker(com.sequenceiq.cloudbreak.polling.AbsolutTimeBasedTimeoutChecker) TelemetryTestDto(com.sequenceiq.it.cloudbreak.dto.telemetry.TelemetryTestDto) SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest) FreeIpaTestDto(com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test) AbstractE2ETest(com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest)

Aggregations

AbsolutTimeBasedTimeoutChecker (com.sequenceiq.cloudbreak.polling.AbsolutTimeBasedTimeoutChecker)1 Description (com.sequenceiq.it.cloudbreak.context.Description)1 FreeIpaTestDto (com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto)1 TelemetryTestDto (com.sequenceiq.it.cloudbreak.dto.telemetry.TelemetryTestDto)1 AbstractE2ETest (com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest)1 SdxDatabaseRequest (com.sequenceiq.sdx.api.model.SdxDatabaseRequest)1 Test (org.testng.annotations.Test)1