summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/data/testserver
diff options
context:
space:
mode:
authorRyan Chu <ryan.chu@qt.io>2019-03-25 18:04:26 +0100
committerRyan Chu <ryan.chu@qt.io>2019-04-25 15:33:06 +0000
commit658f12d7354e82ae552703fa928e1c94315c3a6a (patch)
tree7133e51cc0cac91850c0a5829032898fdbf79ddb /mkspecs/features/data/testserver
parent713f77176e5de34503bd265e00f665b7f6ef05b4 (diff)
Expose docker test server as an internal config to all modules
Before testserver becomes a stable feature, let's keep testserver.prf in "mkspecs/features/unsupported". The test server's shared files will be stored in "mkspecs/features/data/testserver". Because the path of testserver has been changed, all the tests relying on the docker servers should be updated as well. Change-Id: Id2494d2b58ee2a9522d99ae61c6236021506b876 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'mkspecs/features/data/testserver')
-rw-r--r--mkspecs/features/data/testserver/Dockerfile27
1 files changed, 27 insertions, 0 deletions
diff --git a/mkspecs/features/data/testserver/Dockerfile b/mkspecs/features/data/testserver/Dockerfile
new file mode 100644
index 0000000000..8fb664a1d2
--- /dev/null
+++ b/mkspecs/features/data/testserver/Dockerfile
@@ -0,0 +1,27 @@
+# This Dockerfile is used to provision the shared scripts (e.g. startup.sh) and configurations. It
+# relies on the arguments passed by docker-compose file to build additional images for each service.
+# To lean more how it works, please check the topic "Use multi-stage builds".
+# https://docs.docker.com/develop/develop-images/multistage-build/
+
+ARG provisioningImage
+FROM $provisioningImage as testserver_tier2
+
+# Add and merge the testdata into service folder
+ARG serviceDir
+ARG shareDir=$serviceDir
+COPY $serviceDir $shareDir service/
+
+# create the shared script of testserver
+RUN echo "#!/usr/bin/env bash\n" \
+ "set -ex\n" \
+ "for RUN_CMD; do \$RUN_CMD; done\n" \
+ "service dbus restart\n" \
+ "service avahi-daemon restart\n" \
+ "sleep infinity\n" > startup.sh
+RUN chmod +x startup.sh
+
+# rewrite the default configurations of avahi-daemon
+ARG test_domain
+RUN sed -i -e "s,#domain-name=local,domain-name=${test_domain:-test-net.qt.local}," \
+ -e "s,#publish-aaaa-on-ipv4=yes,publish-aaaa-on-ipv4=no," \
+ /etc/avahi/avahi-daemon.conf