use of org.bf2.systemtest.framework.ParallelTest in project kas-fleetshard by bf2fc6cc711aee1a0c2a.
the class OperatorST method testResizeAndCapacity.
@ParallelTest
void testResizeAndCapacity(ExtensionContext extensionContext) throws Exception {
String mkAppName = "mk-test-resize-capacity";
LOGGER.info("Create namespace");
resourceManager.addResource(extensionContext, new NamespaceBuilder().withNewMetadata().withName(mkAppName).endMetadata().build());
LOGGER.info("Create managedkafka");
ManagedKafka mk = ManagedKafkaResourceType.getDefault(mkAppName, mkAppName, null, latestStrimziVersion, latestKafkaVersion);
Quantity quantity = Quantity.parse("100Gi");
// for values below 270Gi, the logic will report a slightly larger values
Quantity reportedQuantity = Quantity.parse("103Gi");
mk.getSpec().getCapacity().setMaxDataRetentionSize(quantity);
mk = resourceManager.createResource(extensionContext, mk);
Resource<ManagedKafka> mkResource = kube.client().resources(ManagedKafka.class).inNamespace(mk.getMetadata().getNamespace()).withName(mk.getMetadata().getName());
assertEquals(reportedQuantity, mk.getStatus().getCapacity().getMaxDataRetentionSize());
LOGGER.info("Trying to shrink");
mk.getSpec().getCapacity().setMaxDataRetentionSize(Quantity.parse("50Gi"));
mk = mkResource.createOrReplace(mk);
String currentVersion = mk.getMetadata().getResourceVersion();
// wait until the status is updated
mk = mkResource.waitUntilCondition(m -> !Objects.equals(currentVersion, m.getMetadata().getResourceVersion()), 2, TimeUnit.MINUTES);
// should be the same, as we can't resize down
assertEquals(reportedQuantity, mk.getStatus().getCapacity().getMaxDataRetentionSize());
LOGGER.info("Trying to grow");
mk.getSpec().getCapacity().setMaxDataRetentionSize(Quantity.parse("200Gi"));
mk = mkResource.createOrReplace(mk);
// should grow - again the size is a little off
Quantity endReportedQuantity = Quantity.parse("202Gi");
mk = mkResource.waitUntilCondition(m -> endReportedQuantity.equals(m.getStatus().getCapacity().getMaxDataRetentionSize()), 5, TimeUnit.MINUTES);
}
use of org.bf2.systemtest.framework.ParallelTest in project kas-fleetshard by bf2fc6cc711aee1a0c2a.
the class SuiteUnitTest method testExecutor.
@ParallelTest
void testExecutor() {
ExecResult result = Exec.builder().withCommand("ls", System.getProperty("user.dir")).logToOutput(false).throwErrors(true).timeout(60).exec();
assertTrue(result.exitStatus());
}
use of org.bf2.systemtest.framework.ParallelTest in project kas-fleetshard by bf2fc6cc711aee1a0c2a.
the class SuiteUnitTest method testKeycloakInstance.
@ParallelTest
void testKeycloakInstance() {
KeycloakInstance k = new KeycloakInstance("keycloak");
assertEquals("https://keycloak.keycloak.svc:8443/auth/realms/demo/protocol/openid-connect/certs", k.getJwksEndpointUri());
assertEquals("admin", k.getUsername());
assertEquals("admin", k.getPassword());
assertNotNull(k.getKeycloakCert());
}
Aggregations