summaryrefslogtreecommitdiffstats
path: root/tests/testserver
Commit message (Collapse)AuthorAgeFilesLines
* Network self-test: make it work with docker/containersTimur Pocheptsov2020-11-1713-0/+915
| | | | | | | Fixes: QTBUG-87740 Pick-to: 5.15 Change-Id: Idfe73708784774188afd40048f81406aa720a554 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix perl script warningMårten Nordheim2020-03-191-1/+1
| | | | | | | | | | The apache logs are filled with warnings about this when it's used. https://blog.gerv.net/2014/10/new-class-of-vulnerability-in-perl-web-applications/ Change-Id: I977d2b022d706d9587c033fd8e80f129e60c439c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* docker-compose now brings up the docker images tagged as "latest"Dimitrios Apostolou2019-12-052-28/+30
| | | | | | | | | | | | | | | | | This is so that we can do simple changes to the docker images in provisioning, without needing to update the tag here. If a backwards-incompatible change in the docker images needs to be committed in provisioning and here, it is possible because the images retain their old unique SHA1 tag, in addition to being tagged as latest. See comment for more details. Requires the change in qt5 repository, with commit sha: e4f9ac5607a329bae045567a339d36469bc4fff6 Task-number: QTBUG-79867 Change-Id: I1bc72edec62487530575d7e113a25afe16d09129 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Share the common configurations among different modulesRyan Chu2019-07-013-179/+55
| | | | | | | | | | | | | | | | | | | This change is used to generalize a template docker-compose file for all modules. Ideally, the leaf module only need to keep a docker compose file for all platforms (docker-compose.yml). NOTE: The version of docker-compose file downgrades from 3.4 to 2.1 because the 'extends' keyword is not supported in Compose version 3.x. Change-Id: I2e36fd9236eda86cb5fcf940d787ccefe9200696 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Fix the timing issue of QFtp tests when using Docker serversRyan Chu2019-05-152-1/+7
| | | | | | | | | | | | | | | | | | | | | | Sometimes, it fails in tst_QFtp::proxy or tst_QFtp::activeMode under the stress test. It complains about "Network operation timed out" on vsftpd.test-net.qt.local. When this issue happens in tst_QFtp::proxy, it shows "USER-ERR reject: 172.18.0.5 (ForkLimit 40)" in the log of ftp-proxy. By default, the ftp-proxy only supports 40 incoming client connections per minute. To make the ftp-proxy more powerful, this change extends the limits from 40 to 2000. When this issue happens in tst_QFtp:activeMode, vsftpd shows 426 Failure writing network stream error. It is a known issue of vsftpd. A quick fix is turning use_sendfile off. Change-Id: Iad50469654041bf30f92ef00805034f0d4aa9c3f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rework QFtp test and resolve the unresolved itemsRyan Chu2019-05-151-0/+4
| | | | | | | | | | | | The proxy_data() defined in tst_qftp.cpp expects five items (bigfile, nonASCII, rfc3252, rfc3252.txt, and upload) in the server folder (ftp/qtest). The file rfc3252 and nonASCII folder were missing. Change-Id: I995d6e254875ade22a1def53187077f1cc8d4c98 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Support multi-stage builds to provision the configurations and test dataRyan Chu2019-04-255-125/+154
| | | | | | | | | | | | | | | | | | | | | | 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>
* Add image layer on windowsMaurice Kalinowski2019-04-252-20/+36
| | | | | | | | | | | The docker-compose files were trying to use volume sharing, which is not supported on Windows in conjunction with docker-machine. Hence create a separate layer on Windows, which copies the configuration files to the target. Change-Id: Ifeacc56198ffc8fb2eb31c14ab91334e22e916f5 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Convert tst_QSslSocket to work with DockerTimur Pocheptsov2019-03-113-2/+10
| | | | | | | 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>
* Convert tst_qudpsocket to use dockerMårten Nordheim2019-03-062-0/+18
| | | | | | | | | 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>
* Port tst_qtcpsocket to the docker serverMårten Nordheim2019-02-282-0/+51
| | | | | | | | 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>
* Convert the QSocks5SocketEngine test to use DockerMårten Nordheim2019-02-282-0/+46
| | | | | Change-Id: I5d223758471a72c93ad57d250001c1de51a208cd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Convert tst_qhttpnetworkconnectionTimur Pocheptsov2019-02-213-0/+8384
| | | | | | | | and make it work with our new docker-based test server Change-Id: I98b5b5b1e2cdca46b7f15be72aa1483d9455403d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Convert tst_qabstractnetwork auto-testTimur Pocheptsov2019-02-119-0/+77
| | | | | | | | to make it work with our new docker-based test server. Change-Id: I76345a2d3d768b8a571f2c85e69f6a21e9a96d7e Reviewed-by: Ryan Chu <ryan.chu@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Select single-name SSL certificate for test servers using host networkRyan Chu2019-01-284-1/+20
| | | | | | | | | | | | | On Windows and macOS, the containers are deployed into a virtual machine using the host network. All the containers share the same hostname (qt-test-server), and they are connected to the same network domain (local). When running test in such platforms, use the single-name SSL certificate (qt-test-server.local) for SSL related tests. Change-Id: Idf33e01e8dd8814510d848b87b59b5fc0edc903e Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Remove useless fall-back network interface of Dante-serverRyan Chu2019-01-232-8/+8
| | | | | | | | | | Setting the fall-back network interface of danted's environment to eth0 by docker-compose file is redundant because the value of danted's configuration (danted.conf) has been set to eth0 by default. Change-Id: If2dea8daaf851577a573e201e9c50684916e5206 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Fix QNetworkReply ServiceUnavailableError in macOSRyan Chu2019-01-231-0/+10
| | | | | | | | | | | | | | | | | | | | | | | For macOS and Windows, the test-server containers are deployed in the VirtualBox (Boot2Docker). Because Boot2Docker is a lightweight Linux distribution made specifically to run Docker containers, it doesn't install avahi-daemon and support mDNS discovery. To resolve this problem, Docker compose file supports "extra_hosts" to add hostname mappings inside containers. BFAIL items: tst_QNetworkReply::headFromHttp(...+proxy...) (ten cases) tst_QNetworkReply::ioGetWithManyProxies(http-on-http) tst_QNetworkReply::ioGetWithManyProxies(http-on-http2) tst_QNetworkReply::ioGetWithManyProxies(http-on-multiple-http) tst_QNetworkReply::ioGetWithManyProxies(http-on-http+socks) tst_QNetworkReply::ioGetWithManyProxies(http-on-ftp+http+socks) tst_QNetworkReply::ioPostToHttpFromSocket(...+proxy) (twelve cases) tst_QNetworkReply::ioPostToHttpFromSocket(...+proxyauth) (ten cases) Change-Id: Iec55966a9b5f191b7446985a15b49a8b09dcf407 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Use environment variables to replace the hard-code value of domain nameRyan Chu2019-01-232-19/+28
| | | | | | | | | | 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>
* Docker-based test servers for network-related Qt autotests on WindowsRyan Chu2019-01-238-1/+114
| | | | | | | | | | | | | There is no docker bridge on Windows. Docker document recommends using port mapping to connect to a container. The problem is that it causes a port conflict if the user is running a service that binds the same port on the host. This change applies the same solution of macOS to deploy the docker environment into VirtualBox and use the host network option. Task-number: QTQAINFRA-2294 Change-Id: Iedcb8daa39373f02adb59f02eae2775f02870c54 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix the timing issue of vsftpd during boot (probably invalid config)Ryan Chu2019-01-161-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This appears to be a timing issue of vsftpd's initial script (/etc/init.d/vsftpd). When starting the vsftpd service, the script uses a while loop to make sure that the vsftpd process has been created with the expected PID. The problem is that it should sleep if it can't grep the same PID via ps command. while [ ${n} -le 5 ] do _PID="$(if [ -e ...vsftpd.pid ]; then cat ...vsftpd.pid; fi)" if ! ps -C vsftpd | grep -qs "${_PID}" then break fi sleep 1 n=$(( $n + 1 )) done if ! ps -C vsftpd | grep -qs "${_PID}" then log_warning_msg "vsftpd failed - probably invalid config." exit 1 fi However, synchronization based on time is not working in general. This change will rewrite the while loop to an infinite loop and remove the exclamation symbol (!) from the if condition. Upgrading the version of vsftpd is not helpful here because vsftpd_3.0.3-11 (Ubuntu 18.10) didn't resolve it yet. Change-Id: I07382709c33bd9bab61fcea76ab7deca5f630084 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Docker Provisioning: Update the SHA-1 tag of server imagesRyan Chu2018-12-102-10/+10
| | | | | | | | | 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>
* Docker-based test servers for network-related Qt autotests on macOSRyan Chu2018-10-182-1/+81
| | | | | | | | | | | | | There is no docker bridge on macOS. Docker document recommends using port mapping to connect to a container; but it causes a port conflict if the user is running a service that binds the same port on the host. An alternative solution is to deploy the docker environment into VirtualBox and use the host network option. Task-number: QTQAINFRA-2293 Change-Id: I05dc65c5f8b4be7a1b1874a4ec7c034cc68679ca Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Use environment variable to configure the interfaces of a Dante serverRyan Chu2018-10-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | The internal and external keywords in the server configuration are used to specify the network interface (IP address) that the Dante server should bind to. Because docker-compose allows a container to join more than one network (by adding multiple entries under the top level networks key to a docker-compose file), the default server configuration (danted.conf) shall be updated in accordance with the settings in the docker-compose file. The user can pass the setting of a docker-compose file to containers by adding environment variables in the docker-compose file. After the container gets created, the danted.sh script uses the input environment variables to overwrite the default value of internal and external interfaces before starting the Dante server. environment: - danted_internal=eth1 - danted_external=eth1 - danted_auth_internal=eth1 - danted_auth_external=eth1 Change-Id: I7c65cdd136ba5dac387bee5e22e1f4335e960101 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Rework QNetworkReply tests to use docker-based test serversRyan Chu2018-07-277-0/+112
| | | | | | | | | | | | | | | This change frees the tests of their dependence on the Qt internal test server (qt-test-server.qt-test-net). It makes the developers run the tests out of Qt testing infrastructure. If the user has installed Docker engine on their host, the test servers will be built up inside separate Docker containers, and then, the test case goes with the Docker-based test servers. Otherwise, the test case will keep using the Qt internal test server. Task-number: QTQAINFRA-1686 Change-Id: I518bc3675bfd658938509744b0e7e0610bc8bf66 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Enable mDNS service discovery in Docker-based test serversRyan Chu2018-07-104-34/+33
| | | | | | | | | | | | | | | | | | 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>
* Docker-based test servers for network-related Qt autotestsRyan Chu2018-07-0530-0/+898
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>