Skip to content

Commit 1737e47

Browse files
authoredSep 30, 2016
Merge pull request #3553 from elpaso/server-tests-backport
[Server] Backport of the test improved stability
2 parents a8fbf8a + 02dfb4f commit 1737e47

13 files changed

+424
-134
lines changed
 

‎ci/travis/linux/qt5/blacklist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PyQgsMapUnitScale
66
PyQgsPalLabelingServer
77
PyQgsRelationEditWidget
88
PyQgsServer
9+
PyQgsAuthManagerEndpointTest
910
PyQgsServerAccessControl
1011
PyQgsSipCoverage
1112
PyQgsSpatialiteProvider

‎tests/src/python/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,5 @@ IF (WITH_SERVER)
147147
ADD_PYTHON_TEST(PyQgsServerAccessControl test_qgsserver_accesscontrol.py)
148148
ADD_PYTHON_TEST(PyQgsServerWFST test_qgsserver_wfst.py)
149149
ADD_PYTHON_TEST(PyQgsOfflineEditingWFS test_offline_editing_wfs.py)
150+
ADD_PYTHON_TEST(PyQgsAuthManagerEndpointTest test_authmanager_endpoint.py)
150151
ENDIF (WITH_SERVER)

‎tests/src/python/qgis_wrapped_server.py

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
This script launches a QGIS Server listening on port 8081 or on the port
66
specified on the environment variable QGIS_SERVER_DEFAULT_PORT
77
8+
For testing purposes, HTTP Basic can be enabled by setting the following
9+
environment variables:
10+
11+
* QGIS_SERVER_HTTP_BASIC_AUTH (default not set, set to anything to enable)
12+
* QGIS_SERVER_USERNAME (default ="username")
13+
* QGIS_SERVER_PASSWORD (default ="password")
14+
815
.. note:: This program is free software; you can redistribute it and/or modify
916
it under the terms of the GNU General Public License as published by
1017
the Free Software Foundation; either version 2 of the License, or
@@ -24,22 +31,56 @@
2431
import os
2532
import urllib.parse
2633
from http.server import BaseHTTPRequestHandler, HTTPServer
27-
from qgis.server import QgsServer
34+
from qgis.server import QgsServer, QgsServerFilter
2835

2936
try:
3037
QGIS_SERVER_DEFAULT_PORT = int(os.environ['QGIS_SERVER_DEFAULT_PORT'])
3138
except KeyError:
3239
QGIS_SERVER_DEFAULT_PORT = 8081
3340

41+
qgs_server = QgsServer()
42+
43+
if os.environ.get('QGIS_SERVER_HTTP_BASIC_AUTH') is not None:
44+
print('HTTP Basic Authorization Required username:%s password:%s' % (os.environ.get('QGIS_SERVER_USERNAME', 'username'), os.environ.get('QGIS_SERVER_PASSWORD', 'password')))
45+
import base64
46+
47+
class HTTPBasicFilter(QgsServerFilter):
48+
49+
def responseComplete(self):
50+
request = self.serverInterface().requestHandler()
51+
if self.serverInterface().getEnv('HTTP_AUTHORIZATION'):
52+
username, password = base64.b64decode(self.serverInterface().getEnv('HTTP_AUTHORIZATION')[6:]).split(':')
53+
if (username == os.environ.get('QGIS_SERVER_USERNAME', 'username')
54+
and password == os.environ.get('QGIS_SERVER_PASSWORD', 'password')):
55+
return
56+
# No auth ...
57+
request.clearHeaders()
58+
request.setHeader('Status', '401 Authorization required')
59+
request.setHeader('WWW-Authenticate', 'Basic realm="QGIS Server"')
60+
request.clearBody()
61+
request.appendBody('<h1>Authorization required</h1>')
62+
63+
filter = HTTPBasicFilter(qgs_server.serverInterface())
64+
qgs_server.serverInterface().registerFilter(filter)
65+
3466

3567
class Handler(BaseHTTPRequestHandler):
3668

3769
def do_GET(self):
70+
# CGI vars:
71+
for k, v in self.headers.items():
72+
qgs_server.putenv('HTTP_%s' % k.replace(' ', '-').replace('-', '_').replace(' ', '-').upper(), v)
73+
qgs_server.putenv('SERVER_PORT', str(self.server.server_port))
74+
qgs_server.putenv('SERVER_NAME', self.server.server_name)
75+
qgs_server.putenv('REQUEST_URI', self.path)
3876
parsed_path = urllib.parse.urlparse(self.path)
39-
s = QgsServer()
40-
headers, body = s.handleRequest(parsed_path.query)
41-
self.send_response(200)
42-
for k, v in [h.split(':') for h in headers.decode().split('\n') if h]:
77+
headers, body = qgs_server.handleRequest(parsed_path.query)
78+
headers_dict = dict(h.split(': ', 1) for h in headers.decode().split('\n') if h)
79+
try:
80+
self.send_response(int(headers_dict['Status'].split(' ')[0]))
81+
except:
82+
self.send_response(200)
83+
for k, v in headers_dict.items():
4384
self.send_header(k, v)
4485
self.end_headers()
4586
self.wfile.write(body)
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Tests for auth manager WMS/WFS using QGIS Server through HTTP Basic
4+
enabled qgis_wrapped_server.py.
5+
6+
This is an integration test for QGIS Desktop Auth Manager WFS and WMS provider
7+
and QGIS Server WFS/WMS that check if QGIS can use a stored auth manager auth
8+
configuration to access an HTTP Basic protected endpoint.
9+
10+
11+
From build dir, run: ctest -R PyQgsAuthManagerEnpointTest -V
12+
13+
.. note:: This program is free software; you can redistribute it and/or modify
14+
it under the terms of the GNU General Public License as published by
15+
the Free Software Foundation; either version 2 of the License, or
16+
(at your option) any later version.
17+
"""
18+
import os
19+
import sys
20+
import subprocess
21+
import tempfile
22+
import random
23+
import string
24+
import urllib
25+
26+
__author__ = 'Alessandro Pasotti'
27+
__date__ = '18/09/2016'
28+
__copyright__ = 'Copyright 2016, The QGIS Project'
29+
# This will get replaced with a git SHA1 when you do a git archive
30+
__revision__ = '$Format:%H$'
31+
32+
from time import sleep
33+
from shutil import rmtree
34+
35+
from utilities import unitTestDataPath
36+
from qgis.core import (
37+
QgsAuthManager,
38+
QgsAuthMethodConfig,
39+
QgsVectorLayer,
40+
QgsRasterLayer,
41+
)
42+
from qgis.testing import (
43+
start_app,
44+
unittest,
45+
)
46+
47+
try:
48+
QGIS_SERVER_AUTHMANAGER_DEFAULT_PORT = os.environ['QGIS_SERVER_AUTHMANAGER_DEFAULT_PORT']
49+
except:
50+
import socket
51+
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
52+
s.bind(("", 0))
53+
QGIS_SERVER_AUTHMANAGER_DEFAULT_PORT = s.getsockname()[1]
54+
s.close()
55+
56+
QGIS_AUTH_DB_DIR_PATH = tempfile.mkdtemp()
57+
58+
os.environ['QGIS_AUTH_DB_DIR_PATH'] = QGIS_AUTH_DB_DIR_PATH
59+
60+
qgis_app = start_app()
61+
62+
63+
class TestAuthManager(unittest.TestCase):
64+
65+
@classmethod
66+
def setUpClass(cls):
67+
"""Run before all tests:
68+
Creates an auth configuration"""
69+
cls.port = QGIS_SERVER_AUTHMANAGER_DEFAULT_PORT
70+
# Clean env just to be sure
71+
env_vars = ['QUERY_STRING', 'QGIS_PROJECT_FILE']
72+
for ev in env_vars:
73+
try:
74+
del os.environ[ev]
75+
except KeyError:
76+
pass
77+
cls.testdata_path = unitTestDataPath('qgis_server') + '/'
78+
cls.project_path = cls.testdata_path + "test_project.qgs"
79+
# Enable auth
80+
#os.environ['QGIS_AUTH_PASSWORD_FILE'] = QGIS_AUTH_PASSWORD_FILE
81+
authm = QgsAuthManager.instance()
82+
assert (authm.setMasterPassword('masterpassword', True))
83+
cls.auth_config = QgsAuthMethodConfig('Basic')
84+
cls.auth_config.setName('test_auth_config')
85+
cls.username = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(6))
86+
cls.password = cls.username[::-1] # reversed
87+
cls.auth_config.setConfig('username', cls.username)
88+
cls.auth_config.setConfig('password', cls.password)
89+
assert (authm.storeAuthenticationConfig(cls.auth_config)[0])
90+
91+
os.environ['QGIS_SERVER_HTTP_BASIC_AUTH'] = '1'
92+
os.environ['QGIS_SERVER_USERNAME'] = cls.username
93+
os.environ['QGIS_SERVER_PASSWORD'] = cls.password
94+
os.environ['QGIS_SERVER_DEFAULT_PORT'] = str(cls.port)
95+
server_path = os.path.dirname(os.path.realpath(__file__)) + \
96+
'/qgis_wrapped_server.py'
97+
cls.server = subprocess.Popen([sys.executable, server_path],
98+
env=os.environ)
99+
sleep(2)
100+
101+
@classmethod
102+
def tearDownClass(cls):
103+
"""Run after all tests"""
104+
cls.server.terminate()
105+
rmtree(QGIS_AUTH_DB_DIR_PATH)
106+
del cls.server
107+
108+
def setUp(self):
109+
"""Run before each test."""
110+
pass
111+
112+
def tearDown(self):
113+
"""Run after each test."""
114+
pass
115+
116+
@classmethod
117+
def _getWFSLayer(cls, type_name, layer_name=None, authcfg=None):
118+
"""
119+
WFS layer factory
120+
"""
121+
if layer_name is None:
122+
layer_name = 'wfs_' + type_name
123+
parms = {
124+
'srsname': 'EPSG:4326',
125+
'typename': type_name,
126+
'url': 'http://127.0.0.1:%s/?map=%s' % (cls.port, cls.project_path),
127+
'version': 'auto',
128+
'table': '',
129+
}
130+
if authcfg is not None:
131+
parms.update({'authcfg': authcfg})
132+
uri = ' '.join([("%s='%s'" % (k, v.decode('utf-8'))) for k, v in list(parms.items())])
133+
wfs_layer = QgsVectorLayer(uri, layer_name, 'WFS')
134+
return wfs_layer
135+
136+
@classmethod
137+
def _getWMSLayer(cls, layers, layer_name=None, authcfg=None):
138+
"""
139+
WMS layer factory
140+
"""
141+
if layer_name is None:
142+
layer_name = 'wms_' + layers.replace(',', '')
143+
parms = {
144+
'crs': 'EPSG:4326',
145+
'url': 'http://127.0.0.1:%s/?map=%s' % (cls.port, cls.project_path),
146+
'format': 'image/png',
147+
# This is needed because of a really wierd implementation in QGIS Server, that
148+
# replaces _ in the the real layer name with spaces
149+
'layers': urllib.quote(layers.replace('_', ' ')),
150+
'styles': '',
151+
'version': 'auto',
152+
#'sql': '',
153+
}
154+
if authcfg is not None:
155+
parms.update({'authcfg': authcfg})
156+
uri = '&'.join([("%s=%s" % (k, v.replace('=', '%3D'))) for k, v in list(parms.items())])
157+
wms_layer = QgsRasterLayer(uri, layer_name, 'wms')
158+
return wms_layer
159+
160+
def testValidAuthAccess(self):
161+
"""
162+
Access the HTTP Basic protected layer with valid credentials
163+
"""
164+
wfs_layer = self._getWFSLayer('testlayer_èé', authcfg=self.auth_config.id())
165+
self.assertTrue(wfs_layer.isValid())
166+
wms_layer = self._getWMSLayer('testlayer_èé', authcfg=self.auth_config.id())
167+
self.assertTrue(wms_layer.isValid())
168+
169+
def testInvalidAuthAccess(self):
170+
"""
171+
Access the HTTP Basic protected layer with no credentials
172+
"""
173+
wfs_layer = self._getWFSLayer('testlayer èé')
174+
self.assertFalse(wfs_layer.isValid())
175+
wms_layer = self._getWMSLayer('testlayer_èé')
176+
self.assertFalse(wms_layer.isValid())
177+
178+
179+
if __name__ == '__main__':
180+
unittest.main()

‎tests/src/python/test_offline_editing_wfs.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@
5151
from qgis.PyQt.QtCore import QFileInfo
5252

5353
try:
54-
QGIS_SERVER_WFST_DEFAULT_PORT = os.environ['QGIS_SERVER_WFST_DEFAULT_PORT']
54+
QGIS_SERVER_OFFLINE_EDITING_DEFAULT_PORT = os.environ['QGIS_SERVER_OFFLINE_EDITING_DEFAULT_PORT']
5555
except:
56-
QGIS_SERVER_WFST_DEFAULT_PORT = 8081
56+
import socket
57+
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
58+
s.bind(("", 0))
59+
QGIS_SERVER_OFFLINE_EDITING_DEFAULT_PORT = s.getsockname()[1]
60+
s.close()
5761

5862

5963
qgis_app = start_app()
@@ -64,7 +68,7 @@ class TestWFST(unittest.TestCase, OfflineTestBase):
6468
@classmethod
6569
def setUpClass(cls):
6670
"""Run before all tests"""
67-
cls.port = QGIS_SERVER_WFST_DEFAULT_PORT
71+
cls.port = QGIS_SERVER_OFFLINE_EDITING_DEFAULT_PORT
6872
# Create tmp folder
6973
cls.temp_path = tempfile.mkdtemp()
7074
cls.testdata_path = cls.temp_path + '/' + 'wfs_transactional' + '/'

‎tests/src/python/test_qgsserver.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import osgeo.gdal
2626

2727
# Strip path and content length because path may vary
28-
RE_STRIP_PATH = r'MAP=[^&]+|Content-Length: \d+'
28+
RE_STRIP_PATH = r'MAP=[^&]+|Content-Length: \d+|<Attribute typeName="[^>]+'
2929

3030

3131
class TestQgsServer(unittest.TestCase):
@@ -150,28 +150,33 @@ def responseComplete(self):
150150

151151
# WMS tests
152152
def wms_request_compare(self, request, extra=None, reference_file=None):
153-
project = self.testdata_path + "test+project.qgs"
153+
project = self.testdata_path + "test_project.qgs"
154154
assert os.path.exists(project), "Project file not found: " + project
155155

156156
query_string = 'MAP=%s&SERVICE=WMS&VERSION=1.3&REQUEST=%s' % (urllib.quote(project), request)
157157
if extra is not None:
158158
query_string += extra
159159
header, body = [str(_v) for _v in self.server.handleRequest(query_string)]
160160
response = header + body
161-
f = open(self.testdata_path + (request.lower() if not reference_file else reference_file) + '.txt')
161+
reference_path = self.testdata_path + (request.lower() if not reference_file else reference_file) + '.txt'
162+
f = open(reference_path)
162163
expected = f.read()
163164
f.close()
164165
# Store the output for debug or to regenerate the reference documents:
165166
"""
167+
f = open(reference_path, 'wb+')
168+
f.write(response)
169+
f.close()
170+
166171
f = open(os.path.dirname(__file__) + '/expected.txt', 'w+')
167172
f.write(expected)
168173
f.close()
169174
f = open(os.path.dirname(__file__) + '/response.txt', 'w+')
170175
f.write(response)
171176
f.close()
172-
#"""
173-
response = re.sub(RE_STRIP_PATH, '', response)
174-
expected = re.sub(RE_STRIP_PATH, '', expected)
177+
"""
178+
response = re.sub(RE_STRIP_PATH, '*****', response)
179+
expected = re.sub(RE_STRIP_PATH, '*****', expected)
175180

176181
# for older GDAL versions (<2.0), id field will be integer type
177182
if int(osgeo.gdal.VersionInfo()[:1]) < 2:
@@ -214,7 +219,7 @@ def test_project_wms(self):
214219

215220
def wms_inspire_request_compare(self, request):
216221
"""WMS INSPIRE tests"""
217-
project = self.testdata_path + "test+project_inspire.qgs"
222+
project = self.testdata_path + "test_project_inspire.qgs"
218223
assert os.path.exists(project), "Project file not found: " + project
219224

220225
query_string = 'MAP=%s&SERVICE=WMS&VERSION=1.3.0&REQUEST=%s' % (urllib.quote(project), request)
@@ -243,7 +248,7 @@ def test_project_wms_inspire(self):
243248

244249
# WFS tests
245250
def wfs_request_compare(self, request):
246-
project = self.testdata_path + "test+project_wfs.qgs"
251+
project = self.testdata_path + "test_project_wfs.qgs"
247252
assert os.path.exists(project), "Project file not found: " + project
248253

249254
query_string = 'MAP=%s&SERVICE=WFS&VERSION=1.0.0&REQUEST=%s' % (urllib.quote(project), request)
@@ -277,7 +282,7 @@ def test_project_wfs(self):
277282
self.wfs_request_compare(request)
278283

279284
def wfs_getfeature_compare(self, requestid, request):
280-
project = self.testdata_path + "test+project_wfs.qgs"
285+
project = self.testdata_path + "test_project_wfs.qgs"
281286
assert os.path.exists(project), "Project file not found: " + project
282287

283288
query_string = 'MAP=%s&SERVICE=WFS&VERSION=1.0.0&REQUEST=%s' % (urllib.quote(project), request)
@@ -324,7 +329,7 @@ def test_getfeature(self):
324329
self.wfs_getfeature_compare(id, req)
325330

326331
def wfs_getfeature_post_compare(self, requestid, request):
327-
project = self.testdata_path + "test+project_wfs.qgs"
332+
project = self.testdata_path + "test_project_wfs.qgs"
328333
assert os.path.exists(project), "Project file not found: " + project
329334

330335
query_string = 'MAP={}'.format(urllib.quote(project))
@@ -369,7 +374,7 @@ def test_getfeature_post(self):
369374
def test_getLegendGraphics(self):
370375
"""Test that does not return an exception but an image"""
371376
parms = {
372-
'MAP': self.testdata_path + "test%2Bproject.qgs",
377+
'MAP': self.testdata_path + "test_project.qgs",
373378
'SERVICE': 'WMS',
374379
'VERSION': '1.0.0',
375380
'REQUEST': 'GetLegendGraphic',

‎tests/src/python/test_qgsserver_wfst.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@
5858
try:
5959
QGIS_SERVER_WFST_DEFAULT_PORT = os.environ['QGIS_SERVER_WFST_DEFAULT_PORT']
6060
except:
61-
QGIS_SERVER_WFST_DEFAULT_PORT = 8081
61+
import socket
62+
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
63+
s.bind(("", 0))
64+
QGIS_SERVER_WFST_DEFAULT_PORT = s.getsockname()[1]
65+
s.close()
6266

6367

6468
qgis_app = start_app()

‎tests/testdata/qgis_server/getcapabilities.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Content-Length: 5250
1+
Content-Length: 5614
22
Content-Type: text/xml; charset=utf-8
33

44
<?xml version="1.0" encoding="utf-8"?>
5-
<WMS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3" xmlns="http://www.opengis.net/wms" xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd http://www.qgis.org/wms http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;SERVICE=WMS&amp;REQUEST=GetSchemaExtension" xmlns:sld="http://www.opengis.net/sld" xmlns:qgs="http://www.qgis.org/wms">
5+
<WMS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3" xmlns="http://www.opengis.net/wms" xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd http://www.qgis.org/wms http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;SERVICE=WMS&amp;REQUEST=GetSchemaExtension" xmlns:sld="http://www.opengis.net/sld" xmlns:qgs="http://www.qgis.org/wms">
66
<Service>
77
<Name>WMS</Name>
88
<Title>QGIS TestProject</Title>
@@ -30,7 +30,7 @@ Content-Type: text/xml; charset=utf-8
3030
<DCPType>
3131
<HTTP>
3232
<Get>
33-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
33+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
3434
</Get>
3535
</HTTP>
3636
</DCPType>
@@ -45,7 +45,7 @@ Content-Type: text/xml; charset=utf-8
4545
<DCPType>
4646
<HTTP>
4747
<Get>
48-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
48+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
4949
</Get>
5050
</HTTP>
5151
</DCPType>
@@ -59,7 +59,7 @@ Content-Type: text/xml; charset=utf-8
5959
<DCPType>
6060
<HTTP>
6161
<Get>
62-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
62+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
6363
</Get>
6464
</HTTP>
6565
</DCPType>
@@ -70,7 +70,7 @@ Content-Type: text/xml; charset=utf-8
7070
<DCPType>
7171
<HTTP>
7272
<Get>
73-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
73+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
7474
</Get>
7575
</HTTP>
7676
</DCPType>
@@ -80,7 +80,7 @@ Content-Type: text/xml; charset=utf-8
8080
<DCPType>
8181
<HTTP>
8282
<Get>
83-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
83+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
8484
</Get>
8585
</HTTP>
8686
</DCPType>
@@ -90,7 +90,7 @@ Content-Type: text/xml; charset=utf-8
9090
<DCPType>
9191
<HTTP>
9292
<Get>
93-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
93+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
9494
</Get>
9595
</HTTP>
9696
</DCPType>
@@ -131,7 +131,7 @@ Content-Type: text/xml; charset=utf-8
131131
<Title>default</Title>
132132
<LegendURL>
133133
<Format>image/png</Format>
134-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;&amp;SERVICE=WMS&amp;VERSION=1.3&amp;REQUEST=GetLegendGraphic&amp;LAYER=testlayer èé&amp;FORMAT=image/png&amp;STYLE=default"/>
134+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;&amp;SERVICE=WMS&amp;VERSION=1.3&amp;REQUEST=GetLegendGraphic&amp;LAYER=testlayer èé&amp;FORMAT=image/png&amp;STYLE=default"/>
135135
</LegendURL>
136136
</Style>
137137
</Layer>

‎tests/testdata/qgis_server/getprojectsettings.txt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Content-Length: 6268
1+
Content-Length: 6781
22
Content-Type: text/xml; charset=utf-8
33

44
<?xml version="1.0" encoding="utf-8"?>
5-
<WMS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3.0" xmlns="http://www.opengis.net/wms" xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd http://www.qgis.org/wms http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;SERVICE=WMS&amp;REQUEST=GetSchemaExtension" xmlns:sld="http://www.opengis.net/sld" xmlns:qgs="http://www.qgis.org/wms">
5+
<WMS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3.0" xmlns="http://www.opengis.net/wms" xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd http://www.qgis.org/wms http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;SERVICE=WMS&amp;REQUEST=GetSchemaExtension" xmlns:sld="http://www.opengis.net/sld" xmlns:qgs="http://www.qgis.org/wms">
66
<Service>
77
<Name>WMS</Name>
88
<Title>QGIS TestProject</Title>
@@ -30,7 +30,7 @@ Content-Type: text/xml; charset=utf-8
3030
<DCPType>
3131
<HTTP>
3232
<Get>
33-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
33+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
3434
</Get>
3535
</HTTP>
3636
</DCPType>
@@ -45,7 +45,7 @@ Content-Type: text/xml; charset=utf-8
4545
<DCPType>
4646
<HTTP>
4747
<Get>
48-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
48+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
4949
</Get>
5050
</HTTP>
5151
</DCPType>
@@ -59,7 +59,7 @@ Content-Type: text/xml; charset=utf-8
5959
<DCPType>
6060
<HTTP>
6161
<Get>
62-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
62+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
6363
</Get>
6464
</HTTP>
6565
</DCPType>
@@ -70,7 +70,7 @@ Content-Type: text/xml; charset=utf-8
7070
<DCPType>
7171
<HTTP>
7272
<Get>
73-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
73+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
7474
</Get>
7575
</HTTP>
7676
</DCPType>
@@ -80,7 +80,7 @@ Content-Type: text/xml; charset=utf-8
8080
<DCPType>
8181
<HTTP>
8282
<Get>
83-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
83+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
8484
</Get>
8585
</HTTP>
8686
</DCPType>
@@ -90,7 +90,7 @@ Content-Type: text/xml; charset=utf-8
9090
<DCPType>
9191
<HTTP>
9292
<Get>
93-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
93+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
9494
</Get>
9595
</HTTP>
9696
</DCPType>
@@ -102,7 +102,7 @@ Content-Type: text/xml; charset=utf-8
102102
<DCPType>
103103
<HTTP>
104104
<Get>
105-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;"/>
105+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;"/>
106106
</Get>
107107
</HTTP>
108108
</DCPType>
@@ -112,6 +112,9 @@ Content-Type: text/xml; charset=utf-8
112112
<Format>text/xml</Format>
113113
</Exception>
114114
<sld:UserDefinedSymbolization RemoteWFS="0" RemoteWCS="0" InlineFeature="0" UserStyle="1" SupportSLD="1" UserLayer="0"/>
115+
<WFSLayers>
116+
<WFSLayer name="testlayer èé"/>
117+
</WFSLayers>
115118
<Layer queryable="1">
116119
<Name>QGIS Test Project</Name>
117120
<Title>QGIS Test Project</Title>
@@ -145,7 +148,7 @@ Content-Type: text/xml; charset=utf-8
145148
<Title>default</Title>
146149
<LegendURL>
147150
<Format>image/png</Format>
148-
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&amp;&amp;SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetLegendGraphic&amp;LAYER=testlayer èé&amp;FORMAT=image/png&amp;STYLE=default&amp;SLD_VERSION=1.1.0"/>
151+
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project.qgs&amp;&amp;SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetLegendGraphic&amp;LAYER=testlayer èé&amp;FORMAT=image/png&amp;STYLE=default&amp;SLD_VERSION=1.1.0"/>
149152
</LegendURL>
150153
</Style>
151154
<TreeName>testlayer èé</TreeName>

‎tests/testdata/qgis_server/test+project.qgs renamed to ‎tests/testdata/qgis_server/test_project.qgs

Lines changed: 145 additions & 94 deletions
Large diffs are not rendered by default.

‎tests/testdata/qgis_server/wms_getfeatureinfo-text-html.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Content-Length: 360
1+
Content-Length: 512
22
Content-Type: text/html; charset=utf-8
33

44
<HEAD>

0 commit comments

Comments
 (0)
Please sign in to comment.