Version 19 (modified by anon, 3 years ago)

Removed spam links

The regression tests

There are currently 22 tests and you are welcome to write more! To do so, you need any version of PowerDNS beyond 2.9.17 (there may not yet be any), or get a copy of our development repository (see  here).

Running these tests in fact caught three problems in the bind2backend, which proves they are a good thing.

To add tests, head on to pdns/regression-tests and study the contents of the 22 test directories. 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.

Something like this

~/pdns/regression-tests$ ../pdns/pdns_server --local-port=5300 --socket-dir=./ --daemon=no --no-config --launch=bind2 --bind2-config=./named.conf 

We need new tests for LOC, HINFO, RP and all other 'rare' records. You may need to add zones or records to the testzone or the test configuration.

Once written, send the three files you've made to the PowerDNS development mailing list and we'll incorporate them.

The regression tests used to depend on a very specific version of 'dig', which is no longer easily available, so we've written..

sdig

'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', but do note that this requires the 'boost' c++ header files. These are available for debian, red hat, etc etc.

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 ommit any parameters.