use of io.strimzi.systemtest.utils.TestKafkaVersion in project strimzi by strimzi.
the class AbstractUpgradeST method buildMidStepUpgradeData.
protected static Map<String, JsonObject> buildMidStepUpgradeData(JsonObject jsonData) {
List<TestKafkaVersion> testKafkaVersions = TestKafkaVersion.getSupportedKafkaVersions();
TestKafkaVersion testKafkaVersion = testKafkaVersions.get(testKafkaVersions.size() - 1);
Map<String, JsonObject> steps = new HashMap<>();
String midStepUrl = jsonData.getString("urlFrom");
String midStepVersion = jsonData.getString("fromVersion");
String midStepExamples = jsonData.getString("fromExamples");
JsonObject conversionTool = jsonData.getJsonObject("conversionTool");
// X -> 0.22.0 data
JsonObject midStep = JsonObject.mapFrom(jsonData);
JsonObject afterMidStep = JsonObject.mapFrom(jsonData);
if (jsonData.getString("prevVersion").isEmpty()) {
midStep.put("urlFrom", jsonData.getString("urlFrom"));
midStep.put("fromVersion", jsonData.getString("fromVersion"));
midStep.put("fromExamples", jsonData.getString("fromExamples"));
afterMidStep.put("urlFrom", "HEAD");
afterMidStep.put("fromVersion", "HEAD");
afterMidStep.put("fromExamples", "HEAD");
} else {
midStep.put("urlFrom", jsonData.getString("urlPrevVersion"));
midStep.put("fromVersion", jsonData.getString("prevVersion"));
midStep.put("fromExamples", jsonData.getString("prevVersionExamples"));
afterMidStep.put("urlFrom", midStepUrl);
afterMidStep.put("fromVersion", midStepVersion);
afterMidStep.put("fromExamples", midStepExamples);
}
midStep.put("urlTo", midStepUrl);
midStep.put("toVersion", midStepVersion);
midStep.put("toExamples", midStepExamples);
midStep.put("urlToConversionTool", conversionTool.getString("urlToConversionTool"));
midStep.put("toConversionTool", conversionTool.getString("toConversionTool"));
JsonObject midStepProcedures = new JsonObject();
midStepProcedures.put("kafkaVersion", testKafkaVersion.version());
midStepProcedures.put("logMessageVersion", testKafkaVersion.messageVersion());
midStepProcedures.put("interBrokerProtocolVersion", testKafkaVersion.protocolVersion());
midStep.put("proceduresAfterOperatorUpgrade", midStepProcedures);
steps.put("midStep", midStep);
steps.put("toHEAD", afterMidStep);
return steps;
}
use of io.strimzi.systemtest.utils.TestKafkaVersion in project strimzi by strimzi.
the class AbstractUpgradeST method loadJsonUpgradeData.
protected static Stream<Arguments> loadJsonUpgradeData() {
JsonArray upgradeData = readUpgradeJson(UPGRADE_JSON_FILE);
List<Arguments> parameters = new LinkedList<>();
List<TestKafkaVersion> testKafkaVersions = TestKafkaVersion.getSupportedKafkaVersions();
TestKafkaVersion testKafkaVersion = testKafkaVersions.get(testKafkaVersions.size() - 1);
upgradeData.forEach(jsonData -> {
JsonObject data = (JsonObject) jsonData;
data.put("urlTo", "HEAD");
data.put("toVersion", "HEAD");
data.put("toExamples", "HEAD");
// Generate procedures for upgrade
JsonObject procedures = new JsonObject();
procedures.put("kafkaVersion", testKafkaVersion.version());
procedures.put("logMessageVersion", testKafkaVersion.messageVersion());
procedures.put("interBrokerProtocolVersion", testKafkaVersion.protocolVersion());
data.put("proceduresAfterOperatorUpgrade", procedures);
parameters.add(Arguments.of(data.getString("fromVersion"), "HEAD", data.getString("strimziFeatureGatesFlagsBefore").isEmpty() ? "None" : data.getString("strimziFeatureGatesFlagsBefore"), data.getString("strimziFeatureGatesFlagsAfter").isEmpty() ? "None" : data.getString("strimziFeatureGatesFlagsAfter"), data));
});
return parameters.stream();
}
use of io.strimzi.systemtest.utils.TestKafkaVersion in project strimzi by strimzi.
the class OlmUpgradeIsolatedST method testStrimziUpgrade.
@Test
void testStrimziUpgrade(ExtensionContext extensionContext) throws IOException {
JsonArray upgradeData = readUpgradeJson(UPGRADE_JSON_FILE);
JsonObject latestUpgradeData = upgradeData.getJsonObject(upgradeData.size() - 1);
List<TestKafkaVersion> testKafkaVersions = TestKafkaVersion.getSupportedKafkaVersions();
TestKafkaVersion testKafkaVersion = testKafkaVersions.get(testKafkaVersions.size() - 1);
// Generate procedures and data for OLM upgrade
// This is needed, because for upgrade it's generated by method which generated data for parametrized test
JsonObject procedures = new JsonObject();
procedures.put("kafkaVersion", testKafkaVersion.version());
procedures.put("logMessageVersion", testKafkaVersion.messageVersion());
procedures.put("interBrokerProtocolVersion", testKafkaVersion.protocolVersion());
latestUpgradeData.put("proceduresAfterOperatorUpgrade", procedures);
latestUpgradeData.put("toVersion", "HEAD");
latestUpgradeData.put("toExamples", "HEAD");
latestUpgradeData.put("urlTo", "HEAD");
// perform verification of to version
performUpgradeVerification(latestUpgradeData, extensionContext);
}
use of io.strimzi.systemtest.utils.TestKafkaVersion in project strimzi-kafka-operator 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);
// ##############################
}
use of io.strimzi.systemtest.utils.TestKafkaVersion in project strimzi-kafka-operator by strimzi.
the class KafkaUpgradeDowngradeIsolatedST method testUpgradeWithNoMessageAndProtocolVersionsSet.
@IsolatedTest
void testUpgradeWithNoMessageAndProtocolVersionsSet(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);
runVersionChange(initialVersion, newVersion, producerName, consumerName, null, null, 3, 3, testContext);
}
// ##############################
// Validate that continuous clients finished successfully
// ##############################
ClientUtils.waitTillContinuousClientsFinish(producerName, consumerName, INFRA_NAMESPACE, continuousClientsMessageCount);
// ##############################
}
Aggregations