]>
Commit | Line | Data |
---|---|---|
d4886eb4 BH |
1 | These tests can be used to verify standards compliance of PowerDNS and to |
2 | spot regressions. | |
3 | ||
ef67b646 | 4 | Dependencies |
5 | ------------ | |
6 | We 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 | |
15 | Nice to have: | |
3bd5a931 | 16 | * godns q |
ef67b646 | 17 | |
18 | If you omit the tools above, some tests fail, but you can still run the | |
19 | tests. | |
20 | ||
3cbdb99c | 21 | |
ff453a19 | 22 | |
ef67b646 | 23 | Automated tests |
24 | --------------- | |
25 | ||
26 | For a more hands-off approach, make sure PowerDNS is built with suitable | |
27 | modules, and use: | |
28 | ||
d5f41e30 JS |
29 | ```sh |
30 | ./start-test-stop 5300 gmysql | |
3bd5a931 | 31 | ``` |
ef67b646 | 32 | |
33 | To start PowerDNS in gmysql mode (including DNSSEC), run all tests, and | |
34 | write reports, using udp port 5300 in the process. Use: | |
35 | ||
d5f41e30 JS |
36 | ```sh |
37 | ./start-test-stop help | |
3bd5a931 | 38 | ``` |
ef67b646 | 39 | |
40 | to see all available suites. | |
41 | ||
42 | In addition to diff-files in all test dirs, start-test-stop generates a jUnit- | |
43 | compatible XML report. | |
44 | ||
45 | Manual testing | |
46 | -------------- | |
47 | ||
3bd5a931 | 48 | Start PowerDNS with `--no-shuffle` for best results - the 'too-big-udp' test |
ed2eeba6 BH |
49 | fails otherwise, for cosmetical reasons. |
50 | ||
d4886eb4 BH |
51 | Method of operation |
52 | ------------------- | |
53 | ||
1f6c983f | 54 | Each directory contains a command that, when executed, process the 'cleandig' |
d4886eb4 | 55 | output 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 | 57 | files. |
d4886eb4 | 58 | |
3bd5a931 CH |
59 | Then, `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 |
61 | PowerDNS passed the test. |
62 | ||
63 | Caveats | |
64 | ------- | |
65 | ||
f53f3367 | 66 | Optional features of the DNS standard can cause a difference to arise. For |
3bd5a931 | 67 | example, "Bind 8" appears to fail on nearly all our tests, whereas it is in |
d4886eb4 BH |
68 | compliance (except for one case). |
69 | ||
70 | Study the diff output to be sure if there is a problem. | |
71 | ||
72 | How to run | |
73 | ---------- | |
74 | ||
db9f3191 PD |
75 | See beyond this section for information on how to run automatically. |
76 | ||
c00e2b9f | 77 | First make sure PowerDNS has access to the testing zones, which are all |
3bd5a931 | 78 | referred in the `named.conf` file. Use the `zone2sql` tool to create SQL and |
c00e2b9f | 79 | feed it to your database if you want to test one of the sql backends. |
d4886eb4 | 80 | |
1e19d452 | 81 | Run 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 | 90 | or (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 | 98 | or (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 | 108 | Or only sqlite3: |
d5f41e30 | 109 | ```sh |
fc36799c BH |
110 | rm powerdns.sqlite3 |
111 | sqlite3 powerdns.sqlite3 < ../pdns/no-dnssec.schema.sqlite3.sql | |
112 | sqlite3 powerdns.sqlite3 < ../pdns/dnssec.schema.sqlite3.sql | |
113 | ../pdns/backends/bind/zone2sql --named-conf=./named.conf --gsqlite \ | |
114 | --transactions --dnssec | sqlite3 powerdns.sqlite3 | |
115 | echo '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 | 124 | Set the `nameserver` and `port` variables to point to your pdns\_server |
1e19d452 PD |
125 | instance: |
126 | ||
d5f41e30 JS |
127 | ```sh |
128 | nameserver=127.0.0.1 port=5300 ./runtests | |
3bd5a931 | 129 | ``` |
af65a685 | 130 | |
db9f3191 | 131 | |
d4886eb4 BH |
132 | Analysing results |
133 | ----------------- | |
134 | ||
3bd5a931 CH |
135 | Failed 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 | 137 | files in all subdirectories to see what happened. |
f50affa1 RA |
138 | |
139 | ||
140 | Debian Jessie notes | |
141 | ------------------- | |
816f89bf | 142 | On debian-jessie, most of these tools can be retrieved with: |
d5f41e30 JS |
143 | ```sh |
144 | sudo apt-get install validns ldnsutils bind9utils libnet-dns-perl | |
145 | sudo apt-get -t jessie-backports install unbound-host libunbound2 | |
f50affa1 RA |
146 | ``` |
147 | ||
816f89bf | 148 | libnet-dns-perl is needed for one dyndns test. |
f50affa1 | 149 | |
816f89bf | 150 | This does not install the jdnssec-verifyzone tools. The test that will break without that can be disabled with: |
d5f41e30 | 151 | ```sh |
f50affa1 RA |
152 | touch tests/verify-dnssec-zone/allow-missing |
153 | ``` | |
154 | ||
c6b2216a PD |
155 | Getting required daemons from Docker |
156 | ------------------------------------ | |
157 | ||
158 | Please keep in mind that databases may need a few seconds to start up. | |
159 | ||
160 | 'MySQL': | |
161 | ```sh | |
162 | docker run -p 3306:3306 --rm -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 mariadb | |
163 | GMYSQLHOST=127.0.0.1 ./start-test-stop 5300 gmysql | |
164 | ``` | |
165 | ||
166 | Postgres: | |
167 | ```sh | |
168 | docker run -p 5432:5432 --rm -d postgres | |
169 | GPGSQLUSER=postgres PGHOST=127.0.0.1 ./start-test-stop 5300 gpgsql | |
170 | ``` |