Search in sources :

Example 11 with TestKafkaVersion

use of io.strimzi.systemtest.utils.TestKafkaVersion in project strimzi by strimzi.

the class KafkaUpgradeDowngradeIsolatedST method testKafkaClusterDowngrade.

@IsolatedTest
void testKafkaClusterDowngrade(ExtensionContext testContext) {
    List<TestKafkaVersion> sortedVersions = TestKafkaVersion.getSupportedKafkaVersions();
    String clusterName = mapWithClusterNames.get(testContext.getDisplayName());
    String producerName = clusterName + "-producer";
    String consumerName = clusterName + "-consumer";
    for (int x = sortedVersions.size() - 1; x > 0; x--) {
        TestKafkaVersion initialVersion = sortedVersions.get(x);
        TestKafkaVersion newVersion = sortedVersions.get(x - 1);
        // If it is a downgrade then we make sure to use the lower version number for the message format
        String logMsgFormat = newVersion.messageVersion();
        String interBrokerProtocol = newVersion.protocolVersion();
        runVersionChange(initialVersion, newVersion, producerName, consumerName, logMsgFormat, interBrokerProtocol, 3, 3, testContext);
    }
    // ##############################
    // Validate that continuous clients finished successfully
    // ##############################
    ClientUtils.waitTillContinuousClientsFinish(producerName, consumerName, INFRA_NAMESPACE, continuousClientsMessageCount);
// ##############################
}
Also used : TestKafkaVersion(io.strimzi.systemtest.utils.TestKafkaVersion) IsolatedTest(io.strimzi.systemtest.annotations.IsolatedTest)

Example 12 with TestKafkaVersion

use of io.strimzi.systemtest.utils.TestKafkaVersion in project strimzi by strimzi.

the class KafkaUpgradeDowngradeIsolatedST method testKafkaClusterUpgrade.

@IsolatedTest
void testKafkaClusterUpgrade(ExtensionContext testContext) {
    List<TestKafkaVersion> sortedVersions = TestKafkaVersion.getSupportedKafkaVersions();
    String producerName = clusterName + "-producer";
    String consumerName = clusterName + "-consumer";
    for (int x = 0; x < sortedVersions.size() - 1; x++) {
        TestKafkaVersion initialVersion = sortedVersions.get(x);
        TestKafkaVersion newVersion = sortedVersions.get(x + 1);
        // If it is an upgrade test we keep the message format as the lower version number
        String logMsgFormat = initialVersion.messageVersion();
        String interBrokerProtocol = initialVersion.protocolVersion();
        runVersionChange(initialVersion, newVersion, producerName, consumerName, logMsgFormat, interBrokerProtocol, 3, 3, testContext);
    }
    // ##############################
    // Validate that continuous clients finished successfully
    // ##############################
    ClientUtils.waitTillContinuousClientsFinish(producerName, consumerName, INFRA_NAMESPACE, continuousClientsMessageCount);
// ##############################
}
Also used : TestKafkaVersion(io.strimzi.systemtest.utils.TestKafkaVersion) IsolatedTest(io.strimzi.systemtest.annotations.IsolatedTest)

Example 13 with TestKafkaVersion

use of io.strimzi.systemtest.utils.TestKafkaVersion in project strimzi by strimzi.

the class KafkaUpgradeDowngradeIsolatedST method testKafkaClusterDowngradeToOlderMessageFormat.

@IsolatedTest
void testKafkaClusterDowngradeToOlderMessageFormat(ExtensionContext testContext) {
    List<TestKafkaVersion> sortedVersions = TestKafkaVersion.getSupportedKafkaVersions();
    String clusterName = mapWithClusterNames.get(testContext.getDisplayName());
    String producerName = clusterName + "-producer";
    String consumerName = clusterName + "-consumer";
    String initLogMsgFormat = sortedVersions.get(0).messageVersion();
    String initInterBrokerProtocol = sortedVersions.get(0).protocolVersion();
    for (int x = sortedVersions.size() - 1; x > 0; x--) {
        TestKafkaVersion initialVersion = sortedVersions.get(x);
        TestKafkaVersion newVersion = sortedVersions.get(x - 1);
        runVersionChange(initialVersion, newVersion, producerName, consumerName, initLogMsgFormat, initInterBrokerProtocol, 3, 3, testContext);
    }
    // ##############################
    // Validate that continuous clients finished successfully
    // ##############################
    ClientUtils.waitTillContinuousClientsFinish(producerName, consumerName, INFRA_NAMESPACE, continuousClientsMessageCount);
// ##############################
}
Also used : TestKafkaVersion(io.strimzi.systemtest.utils.TestKafkaVersion) IsolatedTest(io.strimzi.systemtest.annotations.IsolatedTest)

Example 14 with TestKafkaVersion

use of io.strimzi.systemtest.utils.TestKafkaVersion in project strimzi-kafka-operator by strimzi.

the class KafkaUpgradeDowngradeIsolatedST method testKafkaClusterDowngrade.

@IsolatedTest
void testKafkaClusterDowngrade(ExtensionContext testContext) {
    List<TestKafkaVersion> sortedVersions = TestKafkaVersion.getSupportedKafkaVersions();
    String clusterName = mapWithClusterNames.get(testContext.getDisplayName());
    String producerName = clusterName + "-producer";
    String consumerName = clusterName + "-consumer";
    for (int x = sortedVersions.size() - 1; x > 0; x--) {
        TestKafkaVersion initialVersion = sortedVersions.get(x);
        TestKafkaVersion newVersion = sortedVersions.get(x - 1);
        // If it is a downgrade then we make sure to use the lower version number for the message format
        String logMsgFormat = newVersion.messageVersion();
        String interBrokerProtocol = newVersion.protocolVersion();
        runVersionChange(initialVersion, newVersion, producerName, consumerName, logMsgFormat, interBrokerProtocol, 3, 3, testContext);
    }
    // ##############################
    // Validate that continuous clients finished successfully
    // ##############################
    ClientUtils.waitTillContinuousClientsFinish(producerName, consumerName, INFRA_NAMESPACE, continuousClientsMessageCount);
// ##############################
}
Also used : TestKafkaVersion(io.strimzi.systemtest.utils.TestKafkaVersion) IsolatedTest(io.strimzi.systemtest.annotations.IsolatedTest)

Example 15 with TestKafkaVersion

use of io.strimzi.systemtest.utils.TestKafkaVersion in project strimzi-kafka-operator by strimzi.

the class KafkaUpgradeDowngradeIsolatedST method testKafkaClusterUpgrade.

@IsolatedTest
void testKafkaClusterUpgrade(ExtensionContext testContext) {
    List<TestKafkaVersion> sortedVersions = TestKafkaVersion.getSupportedKafkaVersions();
    String producerName = clusterName + "-producer";
    String consumerName = clusterName + "-consumer";
    for (int x = 0; x < sortedVersions.size() - 1; x++) {
        TestKafkaVersion initialVersion = sortedVersions.get(x);
        TestKafkaVersion newVersion = sortedVersions.get(x + 1);
        // If it is an upgrade test we keep the message format as the lower version number
        String logMsgFormat = initialVersion.messageVersion();
        String interBrokerProtocol = initialVersion.protocolVersion();
        runVersionChange(initialVersion, newVersion, producerName, consumerName, logMsgFormat, interBrokerProtocol, 3, 3, testContext);
    }
    // ##############################
    // Validate that continuous clients finished successfully
    // ##############################
    ClientUtils.waitTillContinuousClientsFinish(producerName, consumerName, INFRA_NAMESPACE, continuousClientsMessageCount);
// ##############################
}
Also used : TestKafkaVersion(io.strimzi.systemtest.utils.TestKafkaVersion) IsolatedTest(io.strimzi.systemtest.annotations.IsolatedTest)

Aggregations

TestKafkaVersion (io.strimzi.systemtest.utils.TestKafkaVersion)18 JsonObject (io.vertx.core.json.JsonObject)10 IsolatedTest (io.strimzi.systemtest.annotations.IsolatedTest)8 JsonArray (io.vertx.core.json.JsonArray)6 HashMap (java.util.HashMap)2 LinkedList (java.util.LinkedList)2 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)2 Test (org.junit.jupiter.api.Test)2 Arguments (org.junit.jupiter.params.provider.Arguments)2