Commit Graph

9 Commits

Author SHA1 Message Date
Ryan Chu
713f77176e Support multi-stage builds to provision the configurations and test data
In order to reuse the test server to the external modules, it is much
easier to share the common configurations (scripts) and test data via
Dockerfile. In addition, the external module can create more layers
depending on their needs. Therefore, supporting multi-stage builds is
needed. The disadvantage is that the docker-compose needs to re-build
the images every time. However, it is just a one-time effort. If the
Dockerfile doesn't get changed, the extra build time can be ignored.

Because of multi-stage builds, the test server will keep a Dockerfile at
least. Therefore, the volume sharing is no more needed. The test data of
a service can be added into the images by using COPY/ADD commands.

NOTE:
This patch relies on docker-compose v1.21.0 (docker-compose build now
supports the use of Dockerfile from outside the build context).

Change-Id: Ib3f6a5fcf6979732ae8a40a494a1360fca4ac7bf
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-04-25 15:32:57 +00:00
Timur Pocheptsov
8d4e8217fd Convert tst_QSslSocket to work with Docker
Change-Id: Ifb075763e3a0c6c08677dd2ae7febbbc8e4e48a9
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-03-11 15:38:58 +00:00
Mårten Nordheim
ca037c0631 Convert tst_qudpsocket to use docker
Currently docker is only used for the "echo" test, and then only the
echo server. The SOCKS5 tests have been disabled from when our current
test server was new.

Change-Id: I21b0c5f10e722a42a0880b2500d1bcbc609a03bf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-03-06 16:05:05 +00:00
Mårten Nordheim
a247d08fae Port tst_qtcpsocket to the docker server
The iptables container launches with extra capabilities to actually be
able to make changes to the tables.

Change-Id: I892fd18853ce882709e21791e6c88217e5029d53
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-02-28 15:48:31 +00:00
Mårten Nordheim
1844f011f6 Convert the QSocks5SocketEngine test to use Docker
Change-Id: I5d223758471a72c93ad57d250001c1de51a208cd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-02-28 15:48:19 +00:00
Ryan Chu
bcaf67258f Use environment variables to replace the hard-code value of domain name
Docker compose file supports variable substitution. When running
docker-compose up, Compose looks for the environment variables from
shell and substitutes the values at runtime.

Change-Id: I5255ead82276fac7db24ee74af453f83ca20bbe6
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-23 15:28:51 +00:00
Ryan Chu
75ee55e22a Docker Provisioning: Update the SHA-1 tag of server images
This update is used to free the dependencies of the specific Ubuntu
packages. It ensures that test server is using the latest version of the
Ubuntu packages to test network changes.

Change-Id: I3257f435e6da02e3c6d5a141ece9c5d025e13065
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-10 22:41:20 +00:00
Ryan Chu
5c5af7155a Enable mDNS service discovery in Docker-based test servers
To resolve the challenge of connecting Docker containers from the host
without extra user-efforts, Avahi is used to publish the Docker-based
test servers (Docker containers) on a local network. It is a free
Zeroconf implementation, and it provides multicast DNS (mDNS) service
discovery. By default, mDNS only resolves hostname ending with the
".local" domain. In this change, the domain name of test servers is
changed to "test-net.qt.local". As stated in the standard, the DNS query
for a local domain will be sent to the mDNS multicast address. It avoids
the need for root access to modify system files.

Task-number: QTQAINFRA-1686
Change-Id: I255fba0720ee6d0e84c9cb5ca9289d4466578922
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-07-10 15:25:14 +00:00
Ryan Chu
9e24b43cb9 Docker-based test servers for network-related Qt autotests
The existing network test server has some limitations. Most notably, it
is not accessible by every Qt developer. Also, some services don't allow
simultaneous access, which causes flaky test results.

Instead of centralizing all the services to one physical machine, the
idea is to build up several dedicated servers inside separate Docker
containers.

1. Create testserver.pri and integrate it into the make check command of
   Qt Test.

2. Define QT_TEST_SERVER flag for changing test parameters at compile
   time.

Task-number: QTQAINFRA-1686
Change-Id: I0422ddb97eb8c11b4818771454851d19671253b1
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
2018-07-05 14:13:36 +00:00