Commit graph

33 commits

Author SHA1 Message Date
Michał Kępień
13e97eb3c4 Prevent useless logging in the "tcp" system test
The regression test for CVE-2020-8620 causes a lot of useless messages
to be logged.  However, globally decreasing the log level for the
affected named instance would be a step too far as debugging information
may be useful for troubleshooting other checks in the "tcp" system test.
Starting a separate named instance for a single check should be avoided
when possible and thus is also not a good solution.  As a compromise,
run "rndc trace 1" for the affected named instance before starting the
regression test for CVE-2020-8620.

(cherry picked from commit 17e5c2a50e)
2021-04-28 08:36:56 +02:00
Evan Hunt
7b2880d191 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.

(cherry picked from commit e43b3c1fa1)
2021-01-12 15:21:14 +01:00
Evan Hunt
df698d73f4 update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
Evan Hunt
267c154a63 shorten the tcp system test
the tcp system test uses the 'packet.pl' test tool to send a packet
thousands of times. this took a long time because the tool was waiting
for replies and parsing them; however, for that particular test the
replies aren't relevant.

this commit uses non-blocking sockets and moves the reply parsing
outside the send loop, which speeds the system test up substantially.

(cherry picked from commit 1ceea908b6)
2020-09-04 14:22:53 -07:00
Ondřej Surý
c978d3efdf Skip the large TCP assertion failure test in the CI environment 2020-09-02 13:11:10 +02:00
Ondřej Surý
92df4ba652 Multiply 1996-alloc_dnsbuf-crash-test.pkt by 300000 via TCP
The test for assertion failure via large TCP packet needs to be repeated
multiple times (we use 300000).  This commit fixes the input file to be
properly hexlified and uses the new packet.pl -r feature to send it
300000 times via TCP.

(cherry picked from commit 5f6eb014aa)
2020-09-02 12:46:43 +02:00
Ondřej Surý
4dc666d474 Add -r <repeats> option to packet.pl
For some tests, we need to send big data streams (for TCP) or repeated
packets (for UDP), this commits adds `-r` option to packet.pl that sends
the same input <repeats> times using the specified protocol.

(cherry picked from commit dd46559a19)
2020-09-02 12:46:43 +02:00
Ondřej Surý
9d3c6785b5 Add PoC for assertion failure on large TCP DNS messages
(cherry picked from commit 2c796bb9c8)
2020-08-31 13:38:17 +02:00
Evan Hunt
a8e9ef194c add a test of normal TCP query behavior before and after high-water test
(cherry picked from commit 1383804597)
2020-03-05 23:27:56 +00:00
Diego Fronza
114520425c Added tcp-highwater test on initial statistics verification
The initial tcp statistics test was not testing tcp-highwater counter,
but only initial number of current TCP clients, so this missing test was
added to ensure initial tcp-highwater value is correct.
2019-12-12 11:23:11 -08:00
Matthijs Mekking
cfaa631f65 Move wait_for_log to conf.sh.common 2019-12-09 13:38:54 +01:00
Evan Hunt
d484b66ae1 improve system tests
- increase prefetch test timing tolerance.
- remove five-second pause and explicit connection closing in tcp test
  as they are no longer necessary.
2019-11-22 16:46:32 -08:00
Witold Kręcicki
37354ee225 netmgr: fix TCP backlog and client quota count
- add support for TCP backlog, using the value provided by config.
 - don't attach to TCP client quota for listening sockets, only
   connected sockets.
2019-11-22 16:46:32 -08:00
Michał Kępień
b50ced528d Fail the "tcp" system test when ans6 fails
Make the "tcp" system test fail if the Python tool used for establishing
TCP connections (ans6) logs a result different than "OK" after
processing a command sent to it (as that means the tool was unable to
successfully perform the requested action), with the exception of
cleanup errors at the end of the test which can be safely ignored.  Note
that the tool not returning any result at all in 10 seconds is still a
fatal error in all cases.
2019-11-19 15:26:56 +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
Evan Hunt
18c9a20f32 make send_command wait for any result, rather than specifically result=OK 2019-11-07 11:32:59 -08:00
Michał Kępień
23ca0ec55b Address ShellCheck warnings
Address all outstanding warnings that ShellCheck reports for
bin/tests/system/tcp/tests.sh.
2019-11-07 11:31:57 -08:00
Michał Kępień
9841635b7f Use "set -e" in the "tcp" system test
Ensure any unexpected failure in the "tcp" system test causes it to be
immediately interrupted with an error to make the aforementioned test
more reliable.  Since the exit code for "expr 0 + 0" is 1, the status
variable needs to be updated using arithmetic expansion.
2019-11-07 11:31:57 -08:00
Michał Kępień
46df363a0d Ensure all "tcp" system test errors are caught
Ensure any "rndc stats" failure causes the "tcp" system test to fail.
Do not hide "rndc stats" output.
2019-11-07 11:31:57 -08:00
Michał Kępień
2f4877d11c Make all "tcp" system test checks numbered
Ensure all checks in the "tcp" system test are numbered, so that
forensic data is preserved in case of any failure.
2019-11-07 11:31:57 -08:00
Michał Kępień
1e22e052d0 Allow retries when checking TCP high-water stats
In the TCP high-water checks, "rndc stats" is run after ans6 reports
that it opened the requested number of TCP connections.  However, we
fail to account for the fact that ns5 might not yet have called accept()
for these connections, in which case the counts output by "rndc stats"
will be off.  To prevent intermittent "tcp" system test failures, allow
the relevant connection count checks to be retried (just once, after one
second, as that should be enough for any system to accept() a dozen TCP
connections under any circumstances).
2019-11-07 11:31:57 -08:00
Michał Kępień
8bb7f1f2a1 Add assert_int_equal() shell function
Add a shell function which is used in the "tcp" system test, but has
been accidentally omitted from !2425.  Make sure the function does not
change the value of "ret" itself, so that the caller can decide what to
do with the function's return value.
2019-11-06 15:24:15 +01:00
Diego Fronza
29be224a04 Added TCP high-water system tests
Note: ans6/ans6.py is a helper script that allows tests.sh to open/close
TCP connections to some BIND instance.
2019-11-06 09:18:27 +01:00
Witold Kręcicki
9532e3256e tcp test: sleep for 1 second before gathering stats to make
sure that the stats are there
2018-12-03 18:49:48 +00: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ý
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
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
Mukund Sivaraman
47d837a499 Make named a singleton process [RT#37908]
Conflicts:
	bin/tests/system/conf.sh.in
	lib/dns/win32/libdns.def.in
	lib/isc/win32/file.c

The merge also needed to update files in legacy and tcp system tests
(newly introduced in master after branch was created) to introduce use
of lockfile.
2014-12-18 12:31:25 +05:30
Francis Dupont
5c5c6d289d Add a TCP only option to server/peer 2014-12-02 14:17:59 +01:00