use of io.strimzi.systemtest.annotations.ParallelTest in project strimzi by strimzi.
the class CustomResourceStatusIsolatedST method testKafkaUserStatus.
@ParallelTest
void testKafkaUserStatus(ExtensionContext extensionContext) {
String userName = mapWithTestUsers.get(extensionContext.getDisplayName());
resourceManager.createResource(extensionContext, KafkaUserTemplates.tlsUser(Constants.INFRA_NAMESPACE, CUSTOM_RESOURCE_STATUS_CLUSTER_NAME, userName).build());
LOGGER.info("Checking status of deployed KafkaUser");
Condition kafkaCondition = KafkaUserResource.kafkaUserClient().inNamespace(Constants.INFRA_NAMESPACE).withName(userName).get().getStatus().getConditions().get(0);
LOGGER.info("KafkaUser Status: {}", kafkaCondition.getStatus());
LOGGER.info("KafkaUser Type: {}", kafkaCondition.getType());
assertThat("KafkaUser is in wrong state!", kafkaCondition.getType(), is(Ready.toString()));
LOGGER.info("KafkaUser is in desired state: Ready");
}
use of io.strimzi.systemtest.annotations.ParallelTest in project strimzi by strimzi.
the class CustomResourceStatusIsolatedST method testKafkaMirrorMaker2Status.
@ParallelTest
@Tag(MIRROR_MAKER2)
@Tag(CONNECT_COMPONENTS)
void testKafkaMirrorMaker2Status(ExtensionContext extensionContext) {
String targetClusterName = mapWithClusterNames.get(extensionContext.getDisplayName());
String mirrorMaker2Name = targetClusterName + "-mirror-maker-2";
String mm2Url = KafkaMirrorMaker2Resources.url(mirrorMaker2Name, Constants.INFRA_NAMESPACE, 8083);
resourceManager.createResource(extensionContext, KafkaTemplates.kafkaEphemeral(targetClusterName, 1, 1).editMetadata().withNamespace(Constants.INFRA_NAMESPACE).endMetadata().build());
resourceManager.createResource(extensionContext, KafkaMirrorMaker2Templates.kafkaMirrorMaker2(mirrorMaker2Name, CUSTOM_RESOURCE_STATUS_CLUSTER_NAME, targetClusterName, 1, false).editMetadata().withNamespace(Constants.INFRA_NAMESPACE).endMetadata().build());
KafkaMirrorMaker2Utils.waitForKafkaMirrorMaker2Ready(Constants.INFRA_NAMESPACE, mirrorMaker2Name);
KafkaMirrorMaker2Utils.waitForKafkaMirrorMaker2ConnectorReadiness(Constants.INFRA_NAMESPACE, mirrorMaker2Name);
assertKafkaMirrorMaker2Status(1, mm2Url, mirrorMaker2Name);
// Corrupt Mirror Maker pods
KafkaMirrorMaker2Resource.replaceKafkaMirrorMaker2ResourceInSpecificNamespace(mirrorMaker2Name, mm2 -> mm2.getSpec().setResources(new ResourceRequirementsBuilder().addToRequests("cpu", new Quantity("100000000m")).build()), Constants.INFRA_NAMESPACE);
KafkaMirrorMaker2Utils.waitForKafkaMirrorMaker2NotReady(Constants.INFRA_NAMESPACE, mirrorMaker2Name);
// Restore Mirror Maker pod
KafkaMirrorMaker2Resource.replaceKafkaMirrorMaker2ResourceInSpecificNamespace(mirrorMaker2Name, mm2 -> mm2.getSpec().setResources(new ResourceRequirementsBuilder().addToRequests("cpu", new Quantity("100m")).build()), Constants.INFRA_NAMESPACE);
KafkaMirrorMaker2Utils.waitForKafkaMirrorMaker2Ready(Constants.INFRA_NAMESPACE, mirrorMaker2Name);
KafkaMirrorMaker2Utils.waitForKafkaMirrorMaker2ConnectorReadiness(Constants.INFRA_NAMESPACE, mirrorMaker2Name);
assertKafkaMirrorMaker2Status(3, mm2Url, mirrorMaker2Name);
// Wait for pods stability and check that pods weren't rolled
PodUtils.verifyThatRunningPodsAreStable(Constants.INFRA_NAMESPACE, KafkaMirrorMaker2Resources.deploymentName(mirrorMaker2Name));
assertKafkaMirrorMaker2Status(3, mm2Url, mirrorMaker2Name);
KafkaMirrorMaker2Utils.waitForKafkaMirrorMaker2ConnectorReadiness(Constants.INFRA_NAMESPACE, mirrorMaker2Name);
}
use of io.strimzi.systemtest.annotations.ParallelTest in project strimzi by strimzi.
the class CustomResourceStatusIsolatedST method testKafkaMirrorMaker2WrongBootstrap.
@ParallelTest
@Tag(MIRROR_MAKER2)
void testKafkaMirrorMaker2WrongBootstrap(ExtensionContext extensionContext) {
String clusterName = mapWithClusterNames.get(extensionContext.getDisplayName());
String mirrorMaker2Name = clusterName + "-mirror-maker-2";
KafkaMirrorMaker2 kafkaMirrorMaker2 = KafkaMirrorMaker2Templates.kafkaMirrorMaker2(mirrorMaker2Name, "non-existing-source", "non-existing-target", 1, false).build();
resourceManager.createResource(extensionContext, false, kafkaMirrorMaker2);
KafkaMirrorMaker2Utils.waitForKafkaMirrorMaker2NotReady(mirrorMaker2Name);
// delete
KafkaMirrorMaker2Resource.kafkaMirrorMaker2Client().inNamespace(Constants.INFRA_NAMESPACE).withName(mirrorMaker2Name).withPropagationPolicy(DeletionPropagation.FOREGROUND).delete();
DeploymentUtils.waitForDeploymentDeletion(KafkaMirrorMaker2Resources.deploymentName(mirrorMaker2Name));
}
use of io.strimzi.systemtest.annotations.ParallelTest in project strimzi by strimzi.
the class CustomResourceStatusIsolatedST method testKafkaTopicStatusNotReady.
@ParallelTest
void testKafkaTopicStatusNotReady(ExtensionContext extensionContext) {
String topicName = mapWithTestTopics.get(extensionContext.getDisplayName());
resourceManager.createResource(extensionContext, false, KafkaTopicTemplates.topic(CUSTOM_RESOURCE_STATUS_CLUSTER_NAME, topicName, 1, 10, 10).editMetadata().withNamespace(Constants.INFRA_NAMESPACE).endMetadata().build());
KafkaTopicUtils.waitForKafkaTopicNotReady(Constants.INFRA_NAMESPACE, topicName);
assertKafkaTopicStatus(1, topicName);
cmdKubeClient(Constants.INFRA_NAMESPACE).deleteByName(KafkaTopic.RESOURCE_KIND, topicName);
KafkaTopicUtils.waitForKafkaTopicDeletion(Constants.INFRA_NAMESPACE, topicName);
}
use of io.strimzi.systemtest.annotations.ParallelTest in project strimzi by strimzi.
the class TopicST method testCreateTopicAfterUnsupportedOperation.
@ParallelTest
void testCreateTopicAfterUnsupportedOperation(ExtensionContext extensionContext) {
String topicName = "topic-with-replication-to-change";
String newTopicName = "another-topic";
KafkaTopic kafkaTopic = KafkaTopicTemplates.topic(TOPIC_CLUSTER_NAME, topicName, namespace).editSpec().withReplicas(3).withPartitions(3).endSpec().build();
resourceManager.createResource(extensionContext, kafkaTopic);
KafkaTopicResource.replaceTopicResourceInSpecificNamespace(topicName, t -> {
t.getSpec().setReplicas(1);
t.getSpec().setPartitions(1);
}, namespace);
KafkaTopicUtils.waitForKafkaTopicNotReady(namespace, topicName);
String exceptedMessage = "Number of partitions cannot be decreased";
assertThat(KafkaTopicResource.kafkaTopicClient().inNamespace(namespace).withName(topicName).get().getStatus().getConditions().get(0).getMessage(), is(exceptedMessage));
String topicCRDMessage = KafkaTopicResource.kafkaTopicClient().inNamespace(namespace).withName(topicName).get().getStatus().getConditions().get(0).getMessage();
assertThat(topicCRDMessage, containsString(exceptedMessage));
KafkaTopic newKafkaTopic = KafkaTopicTemplates.topic(TOPIC_CLUSTER_NAME, newTopicName, 1, 1).editMetadata().withNamespace(namespace).endMetadata().build();
resourceManager.createResource(extensionContext, newKafkaTopic);
assertThat("Topic exists in Kafka itself", hasTopicInKafka(topicName, TOPIC_CLUSTER_NAME));
assertThat("Topic exists in Kafka CR (Kubernetes)", hasTopicInCRK8s(kafkaTopic, topicName));
assertThat("Topic exists in Kafka itself", hasTopicInKafka(newTopicName, TOPIC_CLUSTER_NAME));
assertThat("Topic exists in Kafka CR (Kubernetes)", hasTopicInCRK8s(newKafkaTopic, newTopicName));
cmdKubeClient(namespace).deleteByName(KafkaTopic.RESOURCE_SINGULAR, topicName);
KafkaTopicUtils.waitForKafkaTopicDeletion(namespace, topicName);
cmdKubeClient(namespace).deleteByName(KafkaTopic.RESOURCE_SINGULAR, newTopicName);
KafkaTopicUtils.waitForKafkaTopicDeletion(namespace, newTopicName);
}
Aggregations