0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsCopyright (C) 2000, 2001, 2004, 2010, 2011, 2013, 2015, 2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsThis Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsLicense, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewsfile, You can obtain one at http://mozilla.org/MPL/2.0/.
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson
c13b8351b4dfb18806af4eb3c0fea240d83d1f82Andreas GustafssonThis is a simple test environment for running bind9 system tests
c13b8351b4dfb18806af4eb3c0fea240d83d1f82Andreas Gustafssoninvolving multiple name servers.
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas GustafssonThere are multiple test suites, each in a separate subdirectory and
c13b8351b4dfb18806af4eb3c0fea240d83d1f82Andreas Gustafssoninvolving a different DNS setup. They are:
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson
dd977047669f15fe3ea1a977871d7678cebf5082Andreas Gustafsson dnssec/ DNSSEC tests
dd977047669f15fe3ea1a977871d7678cebf5082Andreas Gustafsson forward/ Forwarding tests
dd977047669f15fe3ea1a977871d7678cebf5082Andreas Gustafsson glue/ Glue handling tests
dd977047669f15fe3ea1a977871d7678cebf5082Andreas Gustafsson limits/ Tests of handling of large data (close to server limits)
dd977047669f15fe3ea1a977871d7678cebf5082Andreas Gustafsson lwresd/ Tests of the lightweight resolver library and daemon
a185ac41ac0627ec711d13bf6fdd8a830b753060Andreas Gustafsson notify/ More NOTIFY tests
1928be262ca25485f4d7f0f6473fc5cafa0c3905Andreas Gustafsson nsupdate/ Dynamic update and IXFR tests
dd977047669f15fe3ea1a977871d7678cebf5082Andreas Gustafsson resolver/ Regression tests for resolver bugs that have been fixed
dd977047669f15fe3ea1a977871d7678cebf5082Andreas Gustafsson (not a complete resolver test suite)
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt rrl/ query rate limiting
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews rpz/ Tests of response policy zone (RPZ) rewriting
b947e1a521c6931f787d6d1b3604d5b138170c3dMukund Sivaraman rpzrecurse/ Another set of RPZ tests to check recursion behavior
dd977047669f15fe3ea1a977871d7678cebf5082Andreas Gustafsson stub/ Tests of stub zone functionality
ca44fe49bec16436cd95ace0af2e244f2096b284Brian Wellington unknown/ Unknown type and class tests
dd977047669f15fe3ea1a977871d7678cebf5082Andreas Gustafsson upforwd/ Update forwarding tests
dd977047669f15fe3ea1a977871d7678cebf5082Andreas Gustafsson views/ Tests of the "views" statement
1928be262ca25485f4d7f0f6473fc5cafa0c3905Andreas Gustafsson xfer/ Zone transfer tests
a185ac41ac0627ec711d13bf6fdd8a830b753060Andreas Gustafsson xferquota/ Zone transfer quota tests
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson
e9918d6a9df388b971a4805844165dd3fc3a88caAndreas GustafssonTypically each test suite sets up 2-5 name servers and then performs
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafssonone or more tests against them. Within the test suite subdirectory,
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafssoneach name server has a separate subdirectory containing its
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafssonconfiguration data. By convention, these subdirectories are named
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson"ns1", "ns2", etc.
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas GustafssonThe tests are completely self-contained and do not require access to
0d50da49baa7d2d39146d46789d88053af5b1b50Michael Sawyerthe real DNS. Generally, one of the test servers (ns1) is set up as a
0d50da49baa7d2d39146d46789d88053af5b1b50Michael Sawyerroot name server and is listed in the hints file of the others.
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas GustafssonTo enable all servers to run on the same machine, they bind to
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafssonseparate virtual IP address on the loopback interface. ns1 runs on
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson10.53.0.1, ns2 on 10.53.0.2, etc. Before running any tests, you must
e1e635578dedd17313312031be2759285c7c8e17Andreas Gustafssonset up these addresses by running "ifconfig.sh up" as root.
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson
17be07ab818846dffb79e898da888a29c919bb02Mark AndrewsMac OS X:
17be07ab818846dffb79e898da888a29c919bb02Mark AndrewsIf you wish to make the interfaces survive across reboots
17be07ab818846dffb79e898da888a29c919bb02Mark Andrewscopy org.isc.bind.system and org.isc.bind.system to
17be07ab818846dffb79e898da888a29c919bb02Mark Andrews/Library/LaunchDaemons then run
17be07ab818846dffb79e898da888a29c919bb02Mark Andrews"launchctl load /Library/LaunchDaemons/org.isc.bind.system.plist" as
17be07ab818846dffb79e898da888a29c919bb02Mark Andrewsroot.
17be07ab818846dffb79e898da888a29c919bb02Mark Andrews
7beeb415ca3f1b230d35a8d385d99d2901cf9ff9Andreas GustafssonThe servers use port 5300 instead of the usual port 53, so they can be
7beeb415ca3f1b230d35a8d385d99d2901cf9ff9Andreas Gustafssonrun without root privileges once the interfaces have been set up.
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson
7beeb415ca3f1b230d35a8d385d99d2901cf9ff9Andreas GustafssonThe tests can be run individually like this:
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson sh run.sh xfer
a185ac41ac0627ec711d13bf6fdd8a830b753060Andreas Gustafsson sh run.sh notify
a185ac41ac0627ec711d13bf6fdd8a830b753060Andreas Gustafsson etc.
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson
7beeb415ca3f1b230d35a8d385d99d2901cf9ff9Andreas GustafssonTo run all the tests, just type "make test".
7beeb415ca3f1b230d35a8d385d99d2901cf9ff9Andreas Gustafsson
5a505fc4c2e99842052d9409790c7da0b5663bceMukund SivaramanWhen running system tests, named and lwresd can be run under
5a505fc4c2e99842052d9409790c7da0b5663bceMukund SivaramanValgrind. The output from Valgrind are sent to per-process files that
5a505fc4c2e99842052d9409790c7da0b5663bceMukund Sivaramancan be reviewed after the test has completed. To enable this, set the
10dd5f62f27b050c0e51d85cbd97e2f5925eb9acMukund SivaramanUSE_VALGRIND environment variable to "helgrind" to run the Helgrind
10dd5f62f27b050c0e51d85cbd97e2f5925eb9acMukund Sivaramantool, or any other value to run the Memcheck tool. To use "helgrind"
10dd5f62f27b050c0e51d85cbd97e2f5925eb9acMukund Sivaramaneffectively, build BIND with --disable-atomic.