mirror of
git://code.qt.io/qt/qt5.git
synced 2026-04-17 10:36:07 +08:00
Update californium docker container
The californium docker container was based on californium 1.0.0, which
is a very old release. This results in some SSL-related errors when
running the Qt CoAP tests in the CI.
This patch updates the docker container. Instead of a custom fork of
a californium server, we use 3.8.0 release tag, and apply a custom
patch locally.
A similar docker container is already uploaded to DockerHub and used
in Qt CoAP examples.
Task-number: QTBUG-114798
Change-Id: I07346f69a6790b4ae648e073440d68f28668cdd0
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
(cherry picked from commit 2ed9f566c1)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
FROM qt_ubuntu_18.04
|
FROM qt_ubuntu_18.04
|
||||||
ARG packages="avahi-daemon maven default-jdk"
|
ARG packages="avahi-daemon maven default-jdk patch"
|
||||||
RUN apt-get update && apt-get -y install $packages
|
RUN apt-get update && apt-get -y install $packages
|
||||||
|
|
||||||
# Get californium-based CoAP test server
|
# Get californium-based CoAP test server
|
||||||
@@ -7,6 +7,8 @@ WORKDIR /root/src
|
|||||||
ADD californium-*.tar.gz .
|
ADD californium-*.tar.gz .
|
||||||
RUN mv californium-* californium
|
RUN mv californium-* californium
|
||||||
WORKDIR /root/src/californium
|
WORKDIR /root/src/californium
|
||||||
|
ADD qt_changes.patch ./
|
||||||
|
RUN patch -p1 < qt_changes.patch
|
||||||
RUN mvn clean install -q -DskipTests
|
RUN mvn clean install -q -DskipTests
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
diff -ruN californium_3.8.0/demo-apps/cf-plugtest-server/src/main/java/org/eclipse/californium/plugtests/PlugtestServer.java californium/demo-apps/cf-plugtest-server/src/main/java/org/eclipse/californium/plugtests/PlugtestServer.java
|
||||||
|
--- californium_3.8.0/demo-apps/cf-plugtest-server/src/main/java/org/eclipse/californium/plugtests/PlugtestServer.java 2023-07-21 11:16:21.142201240 +0200
|
||||||
|
+++ californium/demo-apps/cf-plugtest-server/src/main/java/org/eclipse/californium/plugtests/PlugtestServer.java 2023-07-21 11:16:51.074210378 +0200
|
||||||
|
@@ -100,6 +100,14 @@
|
||||||
|
import org.eclipse.californium.unixhealth.NetSocketHealthLogger;
|
||||||
|
import org.eclipse.californium.unixhealth.NetStatLogger;
|
||||||
|
|
||||||
|
+import org.eclipse.californium.scandium.DTLSConnector;
|
||||||
|
+import org.eclipse.californium.scandium.config.DtlsConnectorConfig;
|
||||||
|
+import org.eclipse.californium.scandium.dtls.pskstore.AdvancedSinglePskStore;
|
||||||
|
+import org.eclipse.californium.core.network.CoapEndpoint;
|
||||||
|
+
|
||||||
|
+import java.net.InetSocketAddress;
|
||||||
|
+import java.net.InetAddress;
|
||||||
|
+
|
||||||
|
import picocli.CommandLine;
|
||||||
|
import picocli.CommandLine.ArgGroup;
|
||||||
|
import picocli.CommandLine.Command;
|
||||||
|
@@ -437,7 +445,23 @@
|
||||||
|
// server.addEndpoint(new CoAPEndpoint(new InetSocketAddress("127.0.0.1", port)));
|
||||||
|
// server.addEndpoint(new CoAPEndpoint(new InetSocketAddress("2a01:c911:0:2010::10", port)));
|
||||||
|
// server.addEndpoint(new CoAPEndpoint(new InetSocketAddress("10.200.1.2", port)));
|
||||||
|
- server.addEndpoints(config);
|
||||||
|
+ // server.addEndpoints(config);
|
||||||
|
+
|
||||||
|
+ CoapEndpoint.Builder endpointBuilder = new CoapEndpoint.Builder();
|
||||||
|
+ endpointBuilder.setPort(5683);
|
||||||
|
+ server.addEndpoint(endpointBuilder.build());
|
||||||
|
+
|
||||||
|
+ AdvancedSinglePskStore pskStore = new AdvancedSinglePskStore("Client_identity", "secretPSK".getBytes());
|
||||||
|
+
|
||||||
|
+ DtlsConnectorConfig.Builder builder = new DtlsConnectorConfig.Builder(new Configuration());
|
||||||
|
+ builder.setAddress(new InetSocketAddress(5684));
|
||||||
|
+ builder.setAdvancedPskStore(pskStore);
|
||||||
|
+ DTLSConnector dtlsConnector = new DTLSConnector(builder.build());
|
||||||
|
+
|
||||||
|
+ endpointBuilder = new CoapEndpoint.Builder();
|
||||||
|
+ endpointBuilder.setConnector(dtlsConnector);
|
||||||
|
+ server.addEndpoint(endpointBuilder.build());
|
||||||
|
+
|
||||||
|
if (server.getEndpoints().isEmpty()) {
|
||||||
|
System.err.println("no endpoint available!");
|
||||||
|
System.exit(ERR_INIT_FAILED);
|
||||||
@@ -89,13 +89,14 @@ DownloadURL \
|
|||||||
FreeCoAP-0.7.tar.gz
|
FreeCoAP-0.7.tar.gz
|
||||||
mv FreeCoAP-0.7.tar.gz "$SERVER_PATH/freecoap/"
|
mv FreeCoAP-0.7.tar.gz "$SERVER_PATH/freecoap/"
|
||||||
|
|
||||||
# Custom fork of Eclipse Californium with changes not upstream
|
# Eclipse Californium 3.8.0, requires to apply a custom patch from
|
||||||
|
# $SERVER_PATH/californium/ before usage
|
||||||
DownloadURL \
|
DownloadURL \
|
||||||
http://ci-files01-hki.intra.qt.io/input/docker/californium-secure-test-server.tar.gz \
|
http://ci-files01-hki.intra.qt.io/input/docker/californium-3.8.0.tar.gz \
|
||||||
https://github.com/sonakur/californium/archive/secure-test-server.tar.gz \
|
https://github.com/eclipse-californium/californium/archive/refs/tags/3.8.0.tar.gz \
|
||||||
0ee7f5d4366b9e31f6d2d42e389cb7a66d2db54987b700a38a3a31e8f38a7a19 \
|
24f8ca393f26c922739462e4586b8ced1ff75f99bfa795defa34a967b5a4a5a0 \
|
||||||
californium-secure-test-server.tar.gz
|
californium-3.8.0.tar.gz
|
||||||
mv californium-secure-test-server.tar.gz "$SERVER_PATH/californium/"
|
mv californium-3.8.0.tar.gz "$SERVER_PATH/californium/"
|
||||||
|
|
||||||
|
|
||||||
echo 'Building the docker images...'
|
echo 'Building the docker images...'
|
||||||
|
|||||||
Reference in New Issue
Block a user