use of io.strimzi.systemtest.utils.TestKafkaVersion in project strimzi-kafka-operator by strimzi.
the class StrimziUpgradeIsolatedST method buildDataForUpgradeAcrossVersions.
private JsonObject buildDataForUpgradeAcrossVersions() throws IOException {
List<TestKafkaVersion> sortedVersions = TestKafkaVersion.getSupportedKafkaVersions();
TestKafkaVersion latestKafkaSupported = sortedVersions.get(sortedVersions.size() - 1);
JsonArray upgradeJson = readUpgradeJson(UPGRADE_JSON_FILE);
JsonObject acrossUpgradeData = upgradeJson.getJsonObject(upgradeJson.size() - 1);
JsonObject startingVersion = getDataForStartUpgrade(upgradeJson);
acrossUpgradeData.put("fromVersion", startingVersion.getValue("fromVersion"));
acrossUpgradeData.put("fromExamples", startingVersion.getValue("fromExamples"));
acrossUpgradeData.put("urlFrom", startingVersion.getValue("urlFrom"));
acrossUpgradeData.put("urlTo", "HEAD");
acrossUpgradeData.put("toVersion", "HEAD");
acrossUpgradeData.put("toExamples", "HEAD");
acrossUpgradeData.put("startingKafkaVersion", startingVersion.getString("oldestKafka"));
acrossUpgradeData.put("defaultKafka", startingVersion.getString("defaultKafka"));
acrossUpgradeData.put("oldestKafka", startingVersion.getString("oldestKafka"));
// Generate procedures for upgrade
JsonObject procedures = new JsonObject();
procedures.put("kafkaVersion", latestKafkaSupported.version());
procedures.put("logMessageVersion", latestKafkaSupported.messageVersion());
procedures.put("interBrokerProtocolVersion", latestKafkaSupported.protocolVersion());
acrossUpgradeData.put("proceduresAfterOperatorUpgrade", procedures);
LOGGER.info("Upgrade Json for the test: {}", acrossUpgradeData.encodePrettily());
return acrossUpgradeData;
}
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);
// ##############################
}
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);
// ##############################
}
Aggregations