1 Some notes on running and extending the recursor tests
6 The recursor regression suite requires a series of available IPs to bind to.
10 $ grep -w lo /etc/network/interfaces
12 iface lo inet loopback
13 up /sbin/ip addr add 10.0.3.0/24 dev lo
15 The suite also requires `bind()` access to port 53. The example config
16 relies on authbind for this:
18 $ ls -al /etc/authbind/byport/53
19 -rwxr-xr-x 1 you you 0 May 31 2012 /etc/authbind/byport/53
21 Note that this file needs to be executable by the user you run as for
24 Other dependencies: daemontools, lua-posix
29 Copy `vars.sample` to `vars`
35 The /24 to bind the various daemons in:
39 How to run the auth server (usually no need to change this):
41 AUTHRUN="exec authbind ../../../pdns/pdns_server --config-dir=. > logfile 2>&1"
43 How to run the recursor (usually, again, no need to change this):
45 RECRUN="exec authbind ../../../pdns/recursordist/pdns_recursor --config-dir=. --socket-dir=. --daemon=no --trace=yes --dont-query= --local-address=$PREFIX.9 --hint-file=hintfile --packetcache-ttl=0 --max-cache-ttl=15 --threads=1 > logfile 2>&1"
51 Write out the various configuration files, create the service dirs (this uses
60 Check that they are all up:
63 configs/10.0.3.10: up (pid 1145) 13 seconds
64 configs/10.0.3.11: up (pid 1141) 13 seconds
65 configs/10.0.3.12: up (pid 1137) 13 seconds
67 configs/10.0.3.8: up (pid 1138) 13 seconds
68 configs/recursor-service: up (pid 1140) 13 seconds
70 (They all need to be up more than a few seconds, otherwise they might be
71 crashing on startup. Check the per-service `logfile` if something is wrong).
77 Various things might go wrong the first time you run the tests. Correct them
78 and try again. If you think you have fixed everything and you still have some
79 tests failing (most importantly the ghost-* tests), run `svc -t configs/*` and
84 12 out of 12 (100.00%) tests passed, 0 were skipped
100 The testing setup consists of one recursor (at .9), one auth for our fake root
101 zone (at .8) and another bunch of auths for deeper zones (at .10 and up).
103 `config.sh` creates all the daemon configs, zonefiles, and, where necessary,
104 Lua prequery scripts to emulate behaviour that `pdns_server` cannot produce
107 Figure out whether your new test needs another zone, and edit config.sh accordingly.
109 Create a new directory for your test. It should at least have `command` (don't forget
110 chmod +x), `description`, and an `expected_result` file (often empty at this stage).
112 When you have that set up, run `./runtests` again. Your test will fail; check the
113 `real_result` file. If it looks alright, copy it to `expected_result`.
115 Congratulations, you have just written a test!