diff options
author | Ryan Chu <ryan.chu@qt.io> | 2018-02-28 16:48:38 +0100 |
---|---|---|
committer | Ryan Chu <ryan.chu@qt.io> | 2018-07-05 14:13:36 +0000 |
commit | 9e24b43cb962d7d0035154a546ef281d0a786162 (patch) | |
tree | b6ff855327bde315a0e6066c13c2b73881abb844 /tests/testserver/apache2/testdata | |
parent | 7cd7d6ab3fbfffff8707271c03bb01bcbe5a6d45 (diff) |
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>
Diffstat (limited to 'tests/testserver/apache2/testdata')
-rw-r--r-- | tests/testserver/apache2/testdata/dav.conf | 7 | ||||
-rw-r--r-- | tests/testserver/apache2/testdata/deflate.conf | 5 | ||||
-rw-r--r-- | tests/testserver/apache2/testdata/main.conf | 56 | ||||
-rw-r--r-- | tests/testserver/apache2/testdata/security.conf | 51 | ||||
-rw-r--r-- | tests/testserver/apache2/testdata/ssl.conf | 2 | ||||
-rwxr-xr-x | tests/testserver/apache2/testdata/www/cgi-bin/echo.cgi | 11 | ||||
-rw-r--r-- | tests/testserver/apache2/testdata/www/htdocs/auth-digest/index.html | 1 | ||||
-rw-r--r-- | tests/testserver/apache2/testdata/www/htdocs/digest-authfile | 1 | ||||
-rw-r--r-- | tests/testserver/apache2/testdata/www/htdocs/fluke.gif | bin | 0 -> 27906 bytes | |||
-rw-r--r-- | tests/testserver/apache2/testdata/www/htdocs/index.html | 3 | ||||
-rwxr-xr-x | tests/testserver/apache2/testdata/www/htdocs/protected/cgi-bin/md5sum.cgi | 6 | ||||
-rw-r--r-- | tests/testserver/apache2/testdata/www/htdocs/rfcs-auth/index.html | 1 |
12 files changed, 144 insertions, 0 deletions
diff --git a/tests/testserver/apache2/testdata/dav.conf b/tests/testserver/apache2/testdata/dav.conf new file mode 100644 index 0000000000..c207c2734b --- /dev/null +++ b/tests/testserver/apache2/testdata/dav.conf @@ -0,0 +1,7 @@ +Alias /dav /home/writeables/dav +<Location /dav> + DAV On + order allow,deny + allow from all + Require all granted +</Location> diff --git a/tests/testserver/apache2/testdata/deflate.conf b/tests/testserver/apache2/testdata/deflate.conf new file mode 100644 index 0000000000..6a15701d49 --- /dev/null +++ b/tests/testserver/apache2/testdata/deflate.conf @@ -0,0 +1,5 @@ +# The default configuration will turn on DEFLATE for files served up +# from everywhere. +# +# For testing purposes, we want DEFLATE off by default, and on only for +# specific paths (which is set elsewhere). diff --git a/tests/testserver/apache2/testdata/main.conf b/tests/testserver/apache2/testdata/main.conf new file mode 100644 index 0000000000..5cfa544623 --- /dev/null +++ b/tests/testserver/apache2/testdata/main.conf @@ -0,0 +1,56 @@ +ServerName apache2.test-net.qt:80 + +NameVirtualHost *:443 + +<VirtualHost *:80> +</VirtualHost> + +<VirtualHost *:443> +SSLEngine On +CustomLog /var/log/apache2/ssl_access.log combined +ErrorLog /var/log/apache2/ssl_error.log +</VirtualHost> + +# default ubuntu config turns off SSLv2 because it is deprecated. +# Turn it back on so we can test it. +SSLProtocol all + +DocumentRoot /home/qt-test-server/www/htdocs +ScriptAlias /qtest/cgi-bin/ "/home/qt-test-server/www/cgi-bin/" +ScriptAlias /qtest/protected/cgi-bin/ "/home/qt-test-server/www/htdocs/protected/cgi-bin/" +Alias /qtest "/home/qt-test-server/www/htdocs/" + +<Directory "/home/qt-test-server/www/htdocs"> + Require all granted +</Directory> + +<Directory "/home/qt-test-server/www/htdocs/rfcs-auth"> + AuthType Basic + AuthName "Restricted Files" + AuthUserFile /home/qt-test-server/passwords + Require user httptest +</Directory> + +<Directory "/home/qt-test-server/www/htdocs/auth-digest"> + AuthType Digest + AuthName "Digest testing" + AuthDigestProvider file + AuthUserFile /home/qt-test-server/www/htdocs/digest-authfile + Require user httptest +</Directory> + +<Directory "/home/qt-test-server/www/htdocs/deflate"> + AddOutputFilterByType DEFLATE text/html text/plain text/xml + Header append Vary User-Agent env=!dont-vary +</Directory> + +<Directory "/home/qt-test-server/www/cgi-bin"> + Options +ExecCGI -Includes + AddHandler cgi-script .cgi .pl + Require all granted +</Directory> + + +<Directory "/home/qt-test-server/www/htdocs/protected/"> + AllowOverride AuthConfig Options +</Directory> diff --git a/tests/testserver/apache2/testdata/security.conf b/tests/testserver/apache2/testdata/security.conf new file mode 100644 index 0000000000..30a8ee3765 --- /dev/null +++ b/tests/testserver/apache2/testdata/security.conf @@ -0,0 +1,51 @@ +# +# Disable access to the entire file system except for the directories that +# are explicitly allowed later. +# +# This currently breaks the configurations that come with some web application +# Debian packages. It will be made the default for the release after lenny. +# +#<Directory /> +# AllowOverride None +# Order Deny,Allow +# Deny from all +#</Directory> + + +# Changing the following options will not really affect the security of the +# server, but might make attacks slightly more difficult in some cases. + +# +# ServerTokens +# This directive configures what you return as the Server HTTP response +# Header. The default is 'Full' which sends information about the OS-Type +# and compiled in modules. +# Set to one of: Full | OS | Minimal | Minor | Major | Prod +# where Full conveys the most information, and Prod the least. +# +#ServerTokens Minimal +ServerTokens OS +#ServerTokens Full + +# +# Optionally add a line containing the server version and virtual host +# name to server-generated pages (internal error documents, FTP directory +# listings, mod_status and mod_info output etc., but not CGI generated +# documents or custom error documents). +# Set to "EMail" to also include a mailto: link to the ServerAdmin. +# Set to one of: On | Off | EMail +# +#ServerSignature Off +ServerSignature On + +# +# Allow TRACE method +# +# Set to "extended" to also reflect the request body (only for testing and +# diagnostic purposes). +# +# Set to one of: On | Off | extended +# +#TraceEnable Off +TraceEnable On + diff --git a/tests/testserver/apache2/testdata/ssl.conf b/tests/testserver/apache2/testdata/ssl.conf new file mode 100644 index 0000000000..d6bbaf0da0 --- /dev/null +++ b/tests/testserver/apache2/testdata/ssl.conf @@ -0,0 +1,2 @@ +SSLCertificateFile /home/qt-test-server/ssl-certs/qt-test-server-cert.pem +SSLCertificateKeyFile /home/qt-test-server/ssl-certs/private/qt-test-server-key.pem diff --git a/tests/testserver/apache2/testdata/www/cgi-bin/echo.cgi b/tests/testserver/apache2/testdata/www/cgi-bin/echo.cgi new file mode 100755 index 0000000000..16315a3db6 --- /dev/null +++ b/tests/testserver/apache2/testdata/www/cgi-bin/echo.cgi @@ -0,0 +1,11 @@ +#!/usr/bin/perl + +if ($ENV{'REQUEST_METHOD'} eq "GET") { + $request = $ENV{'QUERY_STRING'}; +} elsif ($ENV{'REQUEST_METHOD'} eq "POST") { + read(STDIN, $request, $ENV{'CONTENT_LENGTH'}) || die "Could not get query\n"; +} + +print "Content-type: text/plain\n\n"; +print $request; + diff --git a/tests/testserver/apache2/testdata/www/htdocs/auth-digest/index.html b/tests/testserver/apache2/testdata/www/htdocs/auth-digest/index.html new file mode 100644 index 0000000000..fa96496aa0 --- /dev/null +++ b/tests/testserver/apache2/testdata/www/htdocs/auth-digest/index.html @@ -0,0 +1 @@ +digest authentication successful diff --git a/tests/testserver/apache2/testdata/www/htdocs/digest-authfile b/tests/testserver/apache2/testdata/www/htdocs/digest-authfile new file mode 100644 index 0000000000..99963901ce --- /dev/null +++ b/tests/testserver/apache2/testdata/www/htdocs/digest-authfile @@ -0,0 +1 @@ +httptest:Digest testing:5f68f4bc3cd2873a3d547558fe7d9782 diff --git a/tests/testserver/apache2/testdata/www/htdocs/fluke.gif b/tests/testserver/apache2/testdata/www/htdocs/fluke.gif Binary files differnew file mode 100644 index 0000000000..6060cbd4d7 --- /dev/null +++ b/tests/testserver/apache2/testdata/www/htdocs/fluke.gif diff --git a/tests/testserver/apache2/testdata/www/htdocs/index.html b/tests/testserver/apache2/testdata/www/htdocs/index.html new file mode 100644 index 0000000000..abc1df188d --- /dev/null +++ b/tests/testserver/apache2/testdata/www/htdocs/index.html @@ -0,0 +1,3 @@ +<h1>Welcome to qt-test-server</h1> +<img src="fluke.gif" alt="fluke"> +<p>This is a network test server. It serves as a caching ftp and http proxy, transparent http/socks5 proxy, imap, ftp and http server, and more.</p> diff --git a/tests/testserver/apache2/testdata/www/htdocs/protected/cgi-bin/md5sum.cgi b/tests/testserver/apache2/testdata/www/htdocs/protected/cgi-bin/md5sum.cgi new file mode 100755 index 0000000000..e580462b85 --- /dev/null +++ b/tests/testserver/apache2/testdata/www/htdocs/protected/cgi-bin/md5sum.cgi @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "Content-type: text/plain"; +echo "Content-length: 33" +echo +md5sum | cut -f 1 -d " " diff --git a/tests/testserver/apache2/testdata/www/htdocs/rfcs-auth/index.html b/tests/testserver/apache2/testdata/www/htdocs/rfcs-auth/index.html new file mode 100644 index 0000000000..472e6ce55d --- /dev/null +++ b/tests/testserver/apache2/testdata/www/htdocs/rfcs-auth/index.html @@ -0,0 +1 @@ +you found the secret |