7. Teste de Conformidade OGC

O Consórcio Geoespacial Aberto (OGC) fornece testes que podem ser executados gratuitamente par se certificar que um servidor é compatível com uma determinada especificação. Este capítulo fornece um tutorial rápido para configurar os testes de WMS num sistema Ubuntu. Uma documentação detalhada pode ser encontrada no <i>site</i> da Web de OGC.

7.1. pyogctest

pyogctest is a Python tool dedicated to run OGC tests easily. The installation may be done in a virtual environment:

git clone https://github.com/pblottiere/pyogctest
virtualenv venv
source venv/bin/activate
pip install -e pyogctest/

7.2. WMS 1.3.0 test suite

To run the WMS 1.3.0 test suite with success, a test dataset is needed. It can be downloaded using pyogctest:

./pyogctest.py -s wms130 --download

After the download, a teamengine_wms_130.qgs project is available in the new data directory. This project has to be registered as the default project for QGIS Server thanks to the QGIS_SERVER_PROJECT_FILE environment variable. This way, we don’t need to explicitly set the MAP vendor-parameter of QGIS Server.

A specific configuration is also necessary to comply with metadata tests. Indeed, some metadata are available in the data/metadata directory and have to be available for the OGC testing framework thanks to an URL. The easiest option is to configure your web server to have an access through something like http://XXX.XXX.XXX.XXX/metadata/Autos.xml. These metadata URLs are defined in the project and inserted in the WMS GetCapabilities document. So the project needs to be updated according to your testing environment to let QGIS Server generate a valid XML document:

./pyogctest.py -s wms130 -m http://XXX.XXX.XXX.XXX/metadata

Now that everything is properly configured, we can run the WMS 1.3.0 test suite:

./pyogctest.py -s wms130 -u http://XXX.XXX.XXX.XXX/qgisserver