xref: /freebsd/contrib/unbound/doc/README.tests (revision 24e365220007c415f495cf8dcb228ece6002b8b7)
1b7579f77SDag-Erling SmørgravREADME unbound tests
2b7579f77SDag-Erling Smørgrav
3b7579f77SDag-Erling SmørgravFor a quick test that runs unit tests and state machine tests, use
4b7579f77SDag-Erling Smørgrav	make test
5b7579f77SDag-Erling Smørgrav
6b7579f77SDag-Erling SmørgravThere is a long test setup for unbound that needs tools installed. Use
7b7579f77SDag-Erling Smørgrav	make longtest
8b7579f77SDag-Erling SmørgravTo make and run the long tests. The results are summarized at the end.
9b7579f77SDag-Erling Smørgrav
10b7579f77SDag-Erling SmørgravYou need to have the following programs installed and in your PATH.
11b7579f77SDag-Erling Smørgrav* dig - from the bind-tools package. Used to send DNS queries.
12b7579f77SDag-Erling Smørgrav* splint (optional) - for lint test
13b7579f77SDag-Erling Smørgrav* doxygen (optional) - for doc completeness test
14b7579f77SDag-Erling Smørgrav* ldns-testns - from ldns examples. Used as DNS auth server.
15b7579f77SDag-Erling Smørgrav* xxd and nc (optional) - for (malformed) packet transmission.
16b7579f77SDag-Erling SmørgravThe optional programs are detected and can be omitted.
17b7579f77SDag-Erling Smørgrav
18*24e36522SCy SchubertYou can also use prepared Dockerfile to run tests inside docker based on latest gcc image:
19*24e36522SCy Schubert* build container: docker build -t unbound-tester -f contrib/Dockerfile.tests .
20*24e36522SCy Schubert* run container: docker run -it --mount type=bind,source="$(pwd)",target=/usr/src/unbound --rm unbound-tester
21*24e36522SCy Schubert* configure environment: ./configure
22*24e36522SCy Schubert* run test: make test
23*24e36522SCy Schubert* run long tests: make longtest
24*24e36522SCy SchubertIt is worth to mention that you need to enable [ipv6 in your docker daemon configuration](https://docs.docker.com/config/daemon/ipv6/) because some tests need ipv6 network stack.
25*24e36522SCy Schubert
26b7579f77SDag-Erling Smørgravtestdata/ contains the data for tests.
27b7579f77SDag-Erling Smørgravtestcode/ contains scripts and c code for the tests.
28b7579f77SDag-Erling Smørgrav
29b7579f77SDag-Erling Smørgravdo-tests.sh : runs all the tests in the testdata directory.
30b7579f77SDag-Erling Smørgravtestbed.sh : compiles on a set of (user specific) hosts and runs do-tests.
31b7579f77SDag-Erling Smørgrav
32b7579f77SDag-Erling SmørgravTests are run using testcode/mini_tpkg.sh.
33