diff --git a/test-infra/camel-test-infra-cli/src/main/java/org/apache/camel/test/infra/cli/services/CliBuiltContainer.java b/test-infra/camel-test-infra-cli/src/main/java/org/apache/camel/test/infra/cli/services/CliBuiltContainer.java index 133858ed737c6..2bad325bd87a8 100644 --- a/test-infra/camel-test-infra-cli/src/main/java/org/apache/camel/test/infra/cli/services/CliBuiltContainer.java +++ b/test-infra/camel-test-infra-cli/src/main/java/org/apache/camel/test/infra/cli/services/CliBuiltContainer.java @@ -25,6 +25,7 @@ import java.util.Objects; import org.apache.camel.test.infra.cli.common.CliProperties; +import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.TestUtils; import org.junit.platform.commons.util.StringUtils; import org.slf4j.Logger; @@ -48,9 +49,6 @@ public class CliBuiltContainer extends GenericContainer { private static final String KEEP_RUNNING_ARG = "KEEP_RUNNING"; private static final String MOUNT_POINT = "/deployments/data"; private static final String SSH_PASSWORD_ARG = "SSH_PASSWORD_ARG"; - // NOTE: make sure to run integration tests locally when changing in order to - // validate potential breaking changes compatibility when building the container - private static final String FROM_IMAGE_NAME = "mirror.gcr.io/fedora:43"; private static final String FROM_IMAGE_ARG = "FROMIMAGE"; protected static final int DEV_CONSOLE_PORT = 8080; protected static final int SSH_PORT = 22; @@ -87,7 +85,7 @@ public CliBuiltContainer(CliBuiltContainerParams params) { .withFileFromClasspath("99-ssh-jbang.conf", "org/apache/camel/test/infra/cli/services/99-ssh-jbang.conf") .withBuildArg(FROM_IMAGE_ARG, TestUtils.prependHubImageNamePrefixIfNeeded( - System.getProperty(CliProperties.FROM_IMAGE, FROM_IMAGE_NAME))) + LocalPropertyResolver.getProperty(CliBuiltContainer.class, CliProperties.FROM_IMAGE))) .withBuildArg(CAMEL_REF_ARG, params.getCamelRef()) .withBuildArg(KEEP_RUNNING_ARG, String.valueOf(params.getKeepContainerRunning())) .withBuildArg(SSH_PASSWORD_ARG, params.getSshPassword()) diff --git a/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/Dockerfile b/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/Dockerfile index 8d81b4faf7ab9..e61e0c4e6a48c 100644 --- a/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/Dockerfile +++ b/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/Dockerfile @@ -15,7 +15,7 @@ # limitations under the License. # -ARG FROMIMAGE +ARG FROMIMAGE=mirror.gcr.io/fedora:43 FROM $FROMIMAGE diff --git a/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/container.properties b/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/container.properties new file mode 100644 index 0000000000000..b51af179ae854 --- /dev/null +++ b/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/container.properties @@ -0,0 +1,20 @@ +## --------------------------------------------------------------------------- +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You under the Apache License, Version 2.0 +## (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## --------------------------------------------------------------------------- +# +# NOTE: make sure to run integration tests locally when changing in order to +# validate potential breaking changes compatibility when building the container +cli.service.from.image=mirror.gcr.io/fedora:43 diff --git a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/common/HiveMQProperties.java b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/common/HiveMQProperties.java index 6393832c0bca0..c7bbf7945d311 100644 --- a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/common/HiveMQProperties.java +++ b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/common/HiveMQProperties.java @@ -26,6 +26,7 @@ public final class HiveMQProperties { public static final String HIVEMQ_CONTAINER = "hivemq.container"; public static final String HIVEMQ_RESOURCE_PATH = "hivemq.resource.path"; public static final String HIVEMQ_SPARKPLUG_CONTAINER = "hivemq.sparkplug.container"; + public static final String HIVEMQ_SPARKPLUG_FROM_IMAGE = "hivemq.sparkplug.from.image"; public static final String HIVEMQ_SPARKPLUG_INSTANCE_SELECTOR = "hivemq-sparkplug"; public static final String HIVEMQ_TEST_SERVICE_NAME = "hivemq"; diff --git a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java index ebf4fbd9ecaa3..e4a4797d862d1 100644 --- a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java +++ b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java @@ -18,6 +18,7 @@ import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; +import org.apache.camel.test.infra.common.TestUtils; import org.apache.camel.test.infra.common.services.ContainerEnvironmentUtil; import org.apache.camel.test.infra.hivemq.common.HiveMQProperties; import org.testcontainers.hivemq.HiveMQContainer; @@ -40,8 +41,14 @@ protected HiveMQContainer initContainer(String imageName) { String dockerfileResourcePath = LocalPropertyResolver.getProperty(LocalHiveMQSparkplugTCKInfraService.class, HiveMQProperties.HIVEMQ_RESOURCE_PATH); + String fromImage = TestUtils.prependHubImageNamePrefixIfNeeded( + LocalPropertyResolver.getProperty( + LocalHiveMQSparkplugTCKInfraService.class, HiveMQProperties.HIVEMQ_SPARKPLUG_FROM_IMAGE)); + ImageFromDockerfile newImage - = new ImageFromDockerfile(imageName, false).withFileFromClasspath(".", dockerfileResourcePath); + = new ImageFromDockerfile(imageName, false) + .withFileFromClasspath(".", dockerfileResourcePath) + .withBuildArg("FROMIMAGE", fromImage); String newImageName = newImage.get(); class TestInfraHiveMQContainer extends HiveMQContainer { diff --git a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/Dockerfile b/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/Dockerfile index 85d62357d46ae..c97438f7bb722 100644 --- a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/Dockerfile +++ b/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/Dockerfile @@ -15,9 +15,9 @@ # limitations under the License. # -ARG HIVEMQ_VERSION=2024.6 +ARG FROMIMAGE=mirror.gcr.io/hivemq/hivemq-ce:2024.6 -FROM mirror.gcr.io/hivemq/hivemq-ce:$HIVEMQ_VERSION as hivemq-ce-sparkplug-tck +FROM $FROMIMAGE as hivemq-ce-sparkplug-tck ARG SPARKPLUG_TCK_VERSION=3.0.0 diff --git a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties b/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties index fd813b675eaf9..713918098f3aa 100644 --- a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties +++ b/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties @@ -16,4 +16,5 @@ ## --------------------------------------------------------------------------- hivemq.container=mirror.gcr.io/hivemq/hivemq-ce:2025.5 hivemq.resource.path=org/apache/camel/test/infra/hivemq/services -hivemq.sparkplug.container=localhost/hivemq-ce-sparkplug-tck:camel \ No newline at end of file +hivemq.sparkplug.container=localhost/hivemq-ce-sparkplug-tck:camel +hivemq.sparkplug.from.image=mirror.gcr.io/hivemq/hivemq-ce:2024.6 diff --git a/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/common/SmbProperties.java b/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/common/SmbProperties.java index 9863a2777db2c..b757e5a09e14d 100644 --- a/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/common/SmbProperties.java +++ b/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/common/SmbProperties.java @@ -22,5 +22,6 @@ public class SmbProperties { public static final String SHARE_NAME = "smb.service.share"; public static final String SMB_USERNAME = "smb.service.username"; public static final String SMB_PASSWORD = "smb.service.password"; + public static final String SMB_FROM_IMAGE = "smb.service.from.image"; } diff --git a/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbContainer.java b/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbContainer.java index 00337793e1d7c..953a46a79d6c1 100644 --- a/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbContainer.java +++ b/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbContainer.java @@ -19,7 +19,10 @@ import java.nio.file.Path; +import org.apache.camel.test.infra.common.LocalPropertyResolver; +import org.apache.camel.test.infra.common.TestUtils; import org.apache.camel.test.infra.common.services.ContainerEnvironmentUtil; +import org.apache.camel.test.infra.smb.common.SmbProperties; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.images.builder.ImageFromDockerfile; @@ -31,6 +34,7 @@ public class SmbContainer extends GenericContainer { public static final String DEFAULT_USER = "camel"; // NOTE: default value used for testing purposes only. public static final String DEFAULT_PASSWORD = "camelTester123"; // NOSONAR + private static final String FROM_IMAGE_ARG = "FROMIMAGE"; public SmbContainer(boolean fixedPort) { super(new ImageFromDockerfile("localhost/samba:camel", false) @@ -41,7 +45,10 @@ public SmbContainer(boolean fixedPort) { .withFileFromClasspath("smb.conf", "org/apache/camel/test/infra/smb/services/smb.conf") .withFileFromClasspath("start.sh", - "org/apache/camel/test/infra/smb/services/start.sh")); + "org/apache/camel/test/infra/smb/services/start.sh") + .withBuildArg(FROM_IMAGE_ARG, + TestUtils.prependHubImageNamePrefixIfNeeded( + LocalPropertyResolver.getProperty(SmbContainer.class, SmbProperties.SMB_FROM_IMAGE)))); ContainerEnvironmentUtil.configurePort(this, fixedPort, SMB_PORT_DEFAULT); diff --git a/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/Dockerfile b/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/Dockerfile index c272160464d41..95131e06f03c0 100644 --- a/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/Dockerfile +++ b/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/Dockerfile @@ -15,7 +15,8 @@ # limitations under the License. # -FROM mirror.gcr.io/fedora:43 as samba +ARG FROMIMAGE=mirror.gcr.io/fedora:43 +FROM $FROMIMAGE as samba LABEL maintainer="orpiske@apache.org" ENV SAMBA_ROOT /opt/camel/samba EXPOSE 139 445 diff --git a/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/container.properties b/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/container.properties new file mode 100644 index 0000000000000..0a047dd4efcfa --- /dev/null +++ b/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/container.properties @@ -0,0 +1,18 @@ +## --------------------------------------------------------------------------- +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You under the Apache License, Version 2.0 +## (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## --------------------------------------------------------------------------- +smb.service.from.image=mirror.gcr.io/fedora:43 +