-
Notifications
You must be signed in to change notification settings - Fork 908
Regression tests
The PowerDNS Source repository includes different types of regression tests.
To add tests, head on to pdns/regression-tests and study the contents of the directories under tests
. To add a new one, simply generate a directory for it, a 'command' file and a 'description' file.
To run the regression tests, run the following in the regression-tests directory:
nameserver=127.0.0.1 port=5300 ./runtests
You'll now find a real_result
file in your new directory. Check if the results are ok, and if so, copy this file to expected_result. Run the tests again, and you'll see them reported as a success this time.
The syntax above expects a PowerDNS running on port 5300, btw. You need to start powerdns with the named.conf as found in the regression-tests directory, or feed it through zone2sql
if you want to test the sql backends.
A much easier approach is to use the start-test-stop
script which will write a configuration for you for your chosen backend, import zone data, etc.
https://raw.githubusercontent.com/PowerDNS/pdns/master/regression-tests/README.md has current information on running tests.
When you write new tests, please open a pull request with your changes.
sdig
is not a dig
replacement, but it does always generate the exact same output, even if the bind people add new features or change their layout. I have no beef with them, my and their needs are just different.
To compile sdig
, run make sdig
(requires the boost
C++ header files).
sdig can be run as follows:
$ sdig 127.0.0.1 5300 example.com ANY
As it is not really meant for human use, the query type at the end is case sensitive! You also can't omit any parameters. See the sdig man page for additional parameters.
Please also read the PowerDNS Documentation that is available from https://doc.powerdns.com/