Commit graph

76 commits

Author SHA1 Message Date
Evan Hunt
a52b17d39b
remove isc_task completely
as there is no further use of isc_task in BIND, this commit removes
it, along with isc_taskmgr, isc_event, and all other related types.

functions that accepted taskmgr as a parameter have been cleaned up.
as a result of this change, some functions can no longer fail, so
they've been changed to type void, and their callers have been
updated accordingly.

the tasks table has been removed from the statistics channel and
the stats version has been updated. dns_dyndbctx has been changed
to reference the loopmgr instead of taskmgr, and DNS_DYNDB_VERSION
has been udpated as well.
2023-02-16 18:35:32 +01:00
Ondřej Surý
32c2acf6fc
Add comment why statistics/ns3 has misconfigure root.hints
To count pending queries in the statistics, we need the ns3 to be
misconfigured.  Document the fact in the statistics/ns3/root.hints.
2022-12-14 18:49:18 +01:00
Ondřej Surý
b679640950
Revert the statistics system test change after we fixed the resolver
When the resolver was refactored, the statistics system test had to be
adjusted in c6b4d82557.  Unfortunately,
this change had to be done because of an error in the resolver
refactoring where timeout would not retry next server, but keep trying
the same server.  As we have now fixed this bug, revert the change to
the test back to the previous state.
2022-12-14 18:49:18 +01:00
Ondřej Surý
b69e783164
Update netmgr, tasks, and applications to use isc_loopmgr
Previously:

* applications were using isc_app as the base unit for running the
  application and signal handling.

* networking was handled in the netmgr layer, which would start a
  number of threads, each with a uv_loop event loop.

* task/event handling was done in the isc_task unit, which used
  netmgr event loops to run the isc_event calls.

In this refactoring:

* the network manager now uses isc_loop instead of maintaining its
  own worker threads and event loops.

* the taskmgr that manages isc_task instances now also uses isc_loopmgr,
  and every isc_task runs on a specific isc_loop bound to the specific
  thread.

* applications have been updated as necessary to use the new API.

* new ISC_LOOP_TEST macros have been added to enable unit tests to
  run isc_loop event loops. unit tests have been updated to use this
  where needed.
2022-08-26 09:09:24 +02:00
Ondřej Surý
d1433da524 Wait for TCP connection refused in the statistics system test
The statistics system test makes a query to foo.info to check for the
pending connections because the ans4 doesn't respond to the query.

This might or might not (depending on exact timing) increment the failed
TCP connection counter when the query is retried over TCP because ans4
doesn't listen on the TCP.

Wait for the 'connection refused' in the ns3 log file to be able to
count the exactly 1 failed TCP connection.
2022-07-14 13:08:29 -07:00
Mark Andrews
ce324ae8ba Use DEFAULT_HMAC for rndc 2022-07-07 10:11:42 +10:00
Michal Nowak
49cb896929
Fix statistics system test on Oracle Linux 7
The statistics system test fails on Oracle Linux 7 when libxml2, Curl,
and xsltproc are present:

    I:statistics:checking bind9.xsl vs xml (17)
    diff: curl.out.17.xsl: No such file or directory
    tests.sh: line 183: curl.out.17.xml: No such file or directory
    cp: cannot stat 'curl.out.17.xml': No such file or directory
    grep: xsltproc.out.17: No such file or directory

This is because the Oracle Linux 7 Curl does not know about the
--http1.1 option and silently fails with:

    + /usr/bin/curl --http1.1 http://10.53.0.3:7252
    curl: option --http1.1: is unknown
    curl: try 'curl --help' or 'curl --manual' for more information

The following test "checking bind9.xml socket statistics" then needs to
check for existence of stats.xml.out file which is artifact of the
previous test.
2022-06-14 09:38:07 +02:00
Evan Hunt
1d706f328c
Remove leftover test code for Windows
- Removed all code that only runs under CYGWIN, and made all
  code that doesn't run under CYGWIN non-optional.
- Removed the $TP variable which was used to add optional
  trailing dots to filenames; they're no longer optional.
- Removed references to pssuspend and dos2unix.
- No need to use environment variables for diff and kill.
- Removed uses of "tr -d '\r'"; this was a workaround for
  a cygwin regex bug that is no longer needed.
2022-01-27 09:08:29 +01:00
Ondřej Surý
58bd26b6cf Update the copyright information in all files in the repository
This commit converts the license handling to adhere to the REUSE
specification.  It specifically:

1. Adds used licnses to LICENSES/ directory

2. Add "isc" template for adding the copyright boilerplate

3. Changes all source files to include copyright and SPDX license
   header, this includes all the C sources, documentation, zone files,
   configuration files.  There are notes in the doc/dev/copyrights file
   on how to add correct headers to the new files.

4. Handle the rest that can't be modified via .reuse/dep5 file.  The
   binary (or otherwise unmodifiable) files could have license places
   next to them in <foo>.license file, but this would lead to cluttered
   repository and most of the files handled in the .reuse/dep5 file are
   system test files.
2022-01-11 09:05:02 +01:00
Mark Andrews
49531e4582 Handle HTTP/1.1 pipelined requests
Check to see whether there are outstanding requests in the
httpd receive buffer after sending the response, and if so,
process them.

Test that pipelined requests are handled by sending multiple
minimal HTTP/1.1 using netcat (nc) and checking that we get
back the same number of responses.
2021-11-04 17:05:29 -07:00
Mark Andrews
04e3ba0b51 Check that bind9.xsl is properly transmitted 2021-11-02 11:18:45 +00:00
Evan Hunt
c167feb1dc Fix statistics test error
The statistics system test sometimes needs a pause to wait for the
expected stats to be reported.

Also, the test for priming queries was ineffective; the result of
the grep was not being checked.
2021-10-18 14:14:33 -07:00
Evan Hunt
a55589f881 remove all references to isc_socket and related types
Removed socket.c, socket.h, and all references to isc_socket_t,
isc_socketmgr_t, isc_sockevent_t, etc.
2021-10-15 01:01:25 -07:00
Evan Hunt
ffbe6268f5 Corrected several system test issues
- serve-stale: dig wasn't always running in background when it should.
  some of the serve-stale test cases are based on groups of dig calls
  running simultaneously in the background: the test pauses and resumes
  running after 'wait'. in some cases the final call to dig in a group
  wasn't in the background, and this sometimes caused delays that
  affected later test results.  in another case, a test was simplified
  and made more reliable by running dig in the foreground removing a
  sleep.

- serve-stale: The extension of the dig timeout period from 10 to 11
  seconds in commit 5307bf64ce was left undone in a few places and has
  now been completed.

- serve-stale: Resolver-query-timeout was set incorrectly.  a comment
  above a test case in serve-stale/tests.sh says: "We configured a long
  value of 30 seconds for resolver-query-timeout," but
  resolver-query-timeout was actually set to 10, not 30. this is now
  fixed.

- rpz: Force retransfer of the fast-expire zone, to ensure it's fully
  loaded in ns3; previously it could have been left unloaded if ns5
  wasn't up yet when ns3 attempted the zone transfer.

- statistics: The TCP4SendErr counter is incremented when a TCP dispatch
  is canceled while sending. depending on test timing, this may have
  happened by the time the statistics are dumped. worked around by
  ignoring that stat couunter when checking for errors.

- hooks: Add a prereq.sh script to prevent running under TSAN.

- zero: Disabled the servfail cache so that SERVFAIL is reported only
  when there actually is a failure, not repeatedly every time the same
  query is sent.
2021-10-02 11:43:59 -07:00
Evan Hunt
cd1bb82d34 use "primary" and "secondary" in statschannel output
zone statistics were still using the old terminology. NOTE: this
change may affect scripts that parse statistics output.
2021-08-30 11:06:12 -07:00
Mark Andrews
53afccf42b save named.stats files 2021-08-02 17:05:06 +10:00
Mark Andrews
592f9ff6bc Test that 'zone-statistics full;' is properly processed 2021-07-16 13:49:22 +10:00
Matthijs Mekking
6c5ff94218 Don't increment network error stats on UV_EOF
When networking statistics was added to the netmgr (in commit
5234a8e00a), two lines were added that
increment the 'STATID_RECVFAIL' statistic: One if 'uv_read_start'
fails and one at the end of the 'read_cb'.  The latter happens
if 'nread < 0'.

According to the libuv documentation, I/O read callbacks (such as for
files and sockets) are passed a parameter 'nread'. If 'nread' is less
than 0, there was an error and 'UV_EOF' is the end of file error, which
you may want to handle differently.

In other words, we should not treat EOF as a RECVFAIL error.
2020-10-20 10:57:16 +02:00
Michał Kępień
5ae33351f2 Deprecate the "glue-cache" option
No issues with the glue cache feature have been reported since its
introduction in BIND 9.12.  As the rationale for introducing the
"glue-cache" option was to have a safety switch readily available in
case the glue cache turns out to cause problems, it is time to deprecate
the option.  Glue cache will be permanently enabled in a future release,
at which point the "glue-cache" option will be made obsolete.
2020-09-16 11:18:07 +02:00
Evan Hunt
dcee985b7f update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
Michal Nowak
093af1c00a
Drop $SYSTEMTESTTOP from bin/tests/system/
The $SYSTEMTESTTOP shell variable if often set to .. in various shell
scripts inside bin/tests/system/, but most of the time it is only
used one line later, while sourcing conf.sh. This hardly improves
code readability.

$SYSTEMTESTTOP is also used for the purpose of referencing
scripts/files living in bin/tests/system/, but given that the
variable is always set to a short, relative path, we can drop it and
replace all of its occurrences with the relative path without adversely
affecting code readability.
2020-07-30 15:58:50 +02:00
Evan Hunt
e43b3c1fa1 further tidying of primary/secondary terminology in system tests
this changes most visble uses of master/slave terminology in tests.sh
and most uses of 'type master' or 'type slave' in named.conf files.
files in the checkconf test were not updated in order to confirm that
the old syntax still works. rpzrecurse was also left mostly unchanged
to avoid interference with DNSRPS.
2020-07-01 11:12:12 -07:00
Evan Hunt
16e14353b1 add "primaries" as a synonym for "masters" in named.conf
as "type primary" is preferred over "type master" now, it makes
sense to make "primaries" available as a synonym too.

added a correctness check to ensure "primaries" and "masters"
cannot both be used in the same zone.
2020-07-01 11:11:34 -07:00
Ondřej Surý
978c7b2e89 Complete rewrite the BIND 9 build system
The rewrite of BIND 9 build system is a large work and cannot be reasonable
split into separate merge requests.  Addition of the automake has a positive
effect on the readability and maintainability of the build system as it is more
declarative, it allows conditional and we are able to drop all of the custom
make code that BIND 9 developed over the years to overcome the deficiencies of
autoconf + custom Makefile.in files.

This squashed commit contains following changes:

- conversion (or rather fresh rewrite) of all Makefile.in files to Makefile.am
  by using automake

- the libtool is now properly integrated with automake (the way we used it
  was rather hackish as the only official way how to use libtool is via
  automake

- the dynamic module loading was rewritten from a custom patchwork to libtool's
  libltdl (which includes the patchwork to support module loading on different
  systems internally)

- conversion of the unit test executor from kyua to automake parallel driver

- conversion of the system test executor from custom make/shell to automake
  parallel driver

- The GSSAPI has been refactored, the custom SPNEGO on the basis that
  all major KRB5/GSSAPI (mit-krb5, heimdal and Windows) implementations
  support SPNEGO mechanism.

- The various defunct tests from bin/tests have been removed:
  bin/tests/optional and bin/tests/pkcs11

- The text files generated from the MD files have been removed, the
  MarkDown has been designed to be readable by both humans and computers

- The xsl header is now generated by a simple sed command instead of
  perl helper

- The <irs/platform.h> header has been removed

- cleanups of configure.ac script to make it more simpler, addition of multiple
  macros (there's still work to be done though)

- the tarball can now be prepared with `make dist`

- the system tests are partially able to run in oot build

Here's a list of unfinished work that needs to be completed in subsequent merge
requests:

- `make distcheck` doesn't yet work (because of system tests oot run is not yet
  finished)

- documentation is not yet built, there's a different merge request with docbook
  to sphinx-build rst conversion that needs to be rebased and adapted on top of
  the automake

- msvc build is non functional yet and we need to decide whether we will just
  cross-compile bind9 using mingw-w64 or fix the msvc build

- contributed dlz modules are not included neither in the autoconf nor automake
2020-04-21 14:19:48 +02:00
Evan Hunt
90a1dabe74 count statistics in netmgr UDP code
- also restored a test in the statistics test which was changed when
  the netmgr was introduced because active sockets were not being
  counted.
2020-01-13 14:09:37 -08:00
Michał Kępień
d8905b7a9c Automatically run clean.sh from run.sh
The first step in all existing setup.sh scripts is to call clean.sh.  To
reduce code duplication and ensure all system tests added in the future
behave consistently with existing ones, invoke clean.sh from run.sh
before calling setup.sh.
2019-12-06 14:11:01 +01:00
Evan Hunt
24510a1fda adjust system tests to deal with possible timing issues
With the netmgr in use, named may start answering queries before zones
are loaded. This can cause transient failures in system tests after
servers are restarted or reconfigured. This commit adds retry loops
and sleep statements where needed to address this problem.

Also incidentally silenced a clang warning.
2019-11-07 12:42:14 -08:00
Mark Andrews
d5c795942f check xsl vs xml 2019-06-26 14:03:53 -07:00
Curtis Blackburn
4f60a84e34 the wrong variable was used to count the test cases in one place. 2019-03-07 20:15:14 -05:00
Evan Hunt
1150a008b2 fix statistics test
the active sockets test is supposed to be commented out on win32, but
only part of it was
2019-01-25 00:44:11 -08:00
Michał Kępień
cc0e8cda71 Include conf.sh from all prereq.sh scripts
Every prereq.sh script must include bin/tests/system/conf.sh, otherwise
if some prerequisite is not met, errors about echo_i not being found
will be printed instead of actual error messages.
2018-07-13 08:22:12 +02:00
Witold Kręcicki
4f9c718803 qname minimization: fix tests 2018-06-12 09:18:47 +02:00
Evan Hunt
a7a2fa296a update system tests so validation won't fail when using IANA key
- all tests with "recursion yes" now also specify "dnssec-validation yes",
  and all tests with "recursion no" also specify "dnssec-validation no".
  this must be maintained in all new tests, or else validation will fail
  when we use local root zones for testing.
- clean.sh has been modified where necessary to remove managed-keys.bind
  and viewname.mkeys files.
2018-05-31 18:22:33 +02:00
Ondřej Surý
55a10b7acd Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
Mark Andrews
4be5667b2c fix temporary file name to have subtest number
(cherry picked from commit e12453f43c88bac722fb511b62f12303735b788c)
2018-03-19 23:14:28 +11:00
Mark Andrews
6e4b5f2345 fix typo 2018-03-19 22:31:22 +11:00
Mark Andrews
dd5dff3096 fix numbering of tests and make consistent 2018-03-19 17:51:04 +11:00
Ondřej Surý
843d389661 Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
Evan Hunt
0c559199bf final cleanup
- add CHANGES note
- update copyrights and license headers
- add -j to the make commands in .gitlab-ci.yml to take
  advantage of parallelization in the gitlab CI process
2018-02-22 22:58:15 -08:00
Evan Hunt
c032c54dda parallelize most system tests 2018-02-22 15:29:02 -08:00
Tinderbox User
278b68ced5 update copyright notice / whitespace 2017-10-28 23:45:38 +00:00
Evan Hunt
06049b1c6c [master] stats counter for priming queries
4795.	[func]		A new statistics counter has been added to track
			priming queries. [RT #46313]
2017-10-26 21:38:43 -07:00
Evan Hunt
5480a74b70 [master] simplify prereq checks by using feature-test.c
4498.	[test]		Simplify prerequisite checks in system tests.
			[RT #43516]
2016-10-31 16:53:37 -07:00
Witold Krecicki
358dfaee18 4487. [test] Make system tests work on Windows. [RT #42931] 2016-10-19 17:18:42 +02:00
Mark Andrews
0c27b3fe77 4401. [misc] Change LICENSE to MPL 2.0. 2016-06-27 14:56:38 +10:00
Tinderbox User
dce54b9b5c update copyright notice / whitespace 2016-06-14 23:45:25 +00:00
Mark Andrews
3635d8f910 do not overflow exit status. [RT #42643] 2016-06-14 13:48:39 +10:00
Mark Andrews
ecfedec0e0 perform a more complete cleanup after running system tests [rt41255] 2015-12-16 11:29:18 +11:00
Evan Hunt
e13d04fda9 [master] fix python script versions
4257.	[cleanup]	Python scripts reported incorrect version. [RT #41080]
2015-11-08 21:34:24 -08:00
Mark Andrews
a70fc47e9d 4243. [func] Improved stats reporting from Timothe Litt. [RT #38941] 2015-10-28 09:45:46 +11:00