]> git.ipfire.org Git - thirdparty/pdns.git/blame - regression-tests/README.md
rec: Add a regression test for the RPZ updates with several deltas
[thirdparty/pdns.git] / regression-tests / README.md
CommitLineData
d4886eb4
BH
1These tests can be used to verify standards compliance of PowerDNS and to
2spot regressions.
3
ef67b646 4Dependencies
5------------
6We need very recent versions of:
7
3bd5a931
CH
8 * validns (http://www.validns.net/)
9 * ldns-verify-zone (part of ldns)
10 * jdnssec-verifyzone (http://www.verisignlabs.com/dnssec-tools/)
11 * named-checkzone (part of BIND9)
12 * unbound-host (part of unbound)
13 * drill (part of ldns)
ef67b646 14
15Nice to have:
3bd5a931 16 * godns q
ef67b646 17
18If you omit the tools above, some tests fail, but you can still run the
19tests.
20
3cbdb99c 21
ff453a19 22
ef67b646 23Automated tests
24---------------
25
26For a more hands-off approach, make sure PowerDNS is built with suitable
27modules, and use:
28
d5f41e30
JS
29```sh
30./start-test-stop 5300 gmysql
3bd5a931 31```
ef67b646 32
33To start PowerDNS in gmysql mode (including DNSSEC), run all tests, and
34write reports, using udp port 5300 in the process. Use:
35
d5f41e30
JS
36```sh
37./start-test-stop help
3bd5a931 38```
ef67b646 39
40to see all available suites.
41
42In addition to diff-files in all test dirs, start-test-stop generates a jUnit-
43compatible XML report.
44
45Manual testing
46--------------
47
3bd5a931 48Start PowerDNS with `--no-shuffle` for best results - the 'too-big-udp' test
ed2eeba6
BH
49fails otherwise, for cosmetical reasons.
50
d4886eb4
BH
51Method of operation
52-------------------
53
1f6c983f 54Each directory contains a command that, when executed, process the 'cleandig'
d4886eb4 55output for the answer the nameserver sent. This output is stored in the file
3bd5a931 56`real_result`, and compared to `expected_result` or one of its replacement
db9f3191 57files.
d4886eb4 58
3bd5a931
CH
59Then, `diff -u` is run on those two files, and the output sent to the file
60`diff`. If everything is as it should be, this diff file is empty, and
d4886eb4
BH
61PowerDNS passed the test.
62
63Caveats
64-------
65
f53f3367 66Optional features of the DNS standard can cause a difference to arise. For
3bd5a931 67example, "Bind 8" appears to fail on nearly all our tests, whereas it is in
d4886eb4
BH
68compliance (except for one case).
69
70Study the diff output to be sure if there is a problem.
71
72How to run
73----------
74
db9f3191
PD
75See beyond this section for information on how to run automatically.
76
c00e2b9f 77First make sure PowerDNS has access to the testing zones, which are all
3bd5a931 78referred in the `named.conf` file. Use the `zone2sql` tool to create SQL and
c00e2b9f 79feed it to your database if you want to test one of the sql backends.
d4886eb4 80
1e19d452 81Run PowerDNS as (to test gmysql):
ade710fb 82
d5f41e30
JS
83```sh
84../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./ \
1f9f3b06 85--no-shuffle --launch=gmysql --gmysql-dbname=pdnstest --gmysql-user=root \
40fc506f 86--fancy-records --query-logging --loglevel=9 \
33d0f97c 87--cache-ttl=0 --no-config
3bd5a931 88```
ade710fb 89
1e19d452 90or (to test bind, without DNSSEC):
d5f41e30
JS
91```sh
92../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./ \
1f9f3b06 93--no-shuffle --launch=bind --bind-config=./named.conf \
40fc506f 94--fancy-records --query-logging --loglevel=9 \
33d0f97c 95--cache-ttl=0 --no-config
3bd5a931 96```
af65a685 97
7fdba01e 98or (to test bind with DNSSEC):
1e19d452 99
d5f41e30
JS
100```sh
101./bind-dnssec-setup
102../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./ \
7fdba01e 103--no-shuffle --launch=bind --bind-config=./named.conf \
40fc506f 104--query-logging --loglevel=9 \
1e19d452 105--cache-ttl=0 --no-config
3bd5a931 106```
1e19d452 107
62d07fb6 108Or only sqlite3:
d5f41e30 109```sh
fc36799c
BH
110rm powerdns.sqlite3
111sqlite3 powerdns.sqlite3 < ../pdns/no-dnssec.schema.sqlite3.sql
112sqlite3 powerdns.sqlite3 < ../pdns/dnssec.schema.sqlite3.sql
113../pdns/backends/bind/zone2sql --named-conf=./named.conf --gsqlite \
114--transactions --dnssec | sqlite3 powerdns.sqlite3
115echo 'analyze;' | sqlite3 powerdns.sqlite3
116
d5f41e30 117../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./ \
62d07fb6
BH
118--no-shuffle --launch=gsqlite3 \
119--gsqlite3-database=./powerdns.sqlite3 --gsqlite3-dnssec \
40fc506f 120--query-logging --loglevel=9 \
62d07fb6 121--cache-ttl=0 --no-config
3bd5a931 122```
62d07fb6 123
3bd5a931 124Set the `nameserver` and `port` variables to point to your pdns\_server
1e19d452
PD
125instance:
126
d5f41e30
JS
127```sh
128nameserver=127.0.0.1 port=5300 ./runtests
3bd5a931 129```
af65a685 130
db9f3191 131
d4886eb4
BH
132Analysing results
133-----------------
134
3bd5a931
CH
135Failed tests appear in the file `failed_tests`, passed tests in
136`passed_tests`. A complete log is in the file `log`. Examine the `diff`
1f9f3b06 137files in all subdirectories to see what happened.
f50affa1
RA
138
139
140Debian Jessie notes
141-------------------
816f89bf 142On debian-jessie, most of these tools can be retrieved with:
d5f41e30
JS
143```sh
144sudo apt-get install validns ldnsutils bind9utils libnet-dns-perl
145sudo apt-get -t jessie-backports install unbound-host libunbound2
f50affa1
RA
146```
147
816f89bf 148libnet-dns-perl is needed for one dyndns test.
f50affa1 149
816f89bf 150This does not install the jdnssec-verifyzone tools. The test that will break without that can be disabled with:
d5f41e30 151```sh
f50affa1
RA
152touch tests/verify-dnssec-zone/allow-missing
153```
154
c6b2216a
PD
155Getting required daemons from Docker
156------------------------------------
157
158Please keep in mind that databases may need a few seconds to start up.
159
160'MySQL':
161```sh
162docker run -p 3306:3306 --rm -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 mariadb
163GMYSQLHOST=127.0.0.1 ./start-test-stop 5300 gmysql
164```
165
166Postgres:
167```sh
6446b9a3 168docker run -p 5432:5432 --rm -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres
c6b2216a
PD
169GPGSQLUSER=postgres PGHOST=127.0.0.1 ./start-test-stop 5300 gpgsql
170```