Commit Graph

11232 Commits

Author SHA1 Message Date
Tom Krizek
0ac22ebc95 Reformat conftest.py with black
(cherry picked from commit 197dac55a2)
2023-09-20 14:51:05 +02:00
Tom Krizek
7a28a76885 Remove legacy runner support from conftest.py
Remove code fork for legacy runner, reorganize imports and move a
pylint-silencing snippet to the top of the file. The rest of the code
was just unindented.

(cherry picked from commit d16e5fd5e5)
2023-09-20 14:51:02 +02:00
Tom Krizek
98191e6371 Remove pytest invocation from legacy runner
In order to python system tests, pytest (runner) has to be used
directly. This makes it possible to simplify the pytest runner and make
its behavior simpler and easier to extend.

The legacy runner can still be used to run shell system tests.

(cherry picked from commit 4af9bafb4e)
2023-09-20 14:50:18 +02:00
Tom Krizek
8c1a1b304c Use 0 exit code for skipped tests in legacy runner
Since the legacy runner is no longer used in the automake test suite,
don't use the special GNU exit code indicating a skipped tests. Instead,
use 0 to avoid considering skipped tests as failed when using simpler
mechanism (such as xargs -P) to run the tests with the legacy runner.
2023-09-20 13:45:41 +02:00
Tom Krizek
01aada479c Remove make check invocation from legacy.run.sh
The legacy runner no longer uses make check. Ensure the legacy runner
script doesn't interact with that automake target in any way. The legacy
runner script remains available to execute the legacy runner, but there
is no out-of-the box support for running tests in parallel. Other tools
such as xargs can be utilized for that.

(cherry picked from commit 0a9ee342e9)
2023-09-20 10:35:27 +02:00
Tom Krizek
ca392c6f64 Modify custom-test-driver to interpret JUnit results
Pytest provides JUnit output and uses different exit codes from
Automake. Use the conversion script to interpret the JUnit test results
from python rather than relying on the status code.

(cherry picked from commit 295890a16b)
2023-09-20 10:33:42 +02:00
Tom Krizek
fce6fa0fc4 Convert JUnit XML from pytest into Automake .trs files
It's important to parse the JUnit result file rather than relying on the
exit code from pytest, which has a different meaning. Include a .trs test
result for each test case and set an exit code which is most appropriate
as the aggregate result (e.g. it will be set to 77 (SKIP) if there's at
least one test case that was skipped).

(cherry picked from commit b96c8e8062)
2023-09-20 10:33:42 +02:00
Tom Krizek
68f186dd82 Prioritize long-running system tests for legacy runner
Synchronize the test priority with the pytest runner (which handles the
prioritization in conftest.py).

(cherry picked from commit 15fa8f1506)
2023-09-20 10:33:38 +02:00
Tom Krizek
a28529c11d Use prereq.sh for rpzrecurse system test
(cherry picked from commit 0538b7e0da)
2023-09-20 10:32:11 +02:00
Tom Krizek
3fb1f2e851 Use prereq.sh for serve-stale system test
(cherry picked from commit c3abedc0a2)
2023-09-20 10:32:11 +02:00
Tom Krizek
27c3e576fd Use prereq.sh for chain system test
(cherry picked from commit 5d9a09c086)
2023-09-20 10:32:11 +02:00
Tom Krizek
74def754f9 Use prereq.sh for digdelv, dnssec, forward system tests
(cherry picked from commit 00b92bd064)
2023-09-20 10:32:11 +02:00
Tom Krizek
53a09edc4f Use prereq.sh for qmin, cookie system tests
(cherry picked from commit 78981cee77)
2023-09-20 10:32:11 +02:00
Tom Krizek
39770409a9 Use prereq.sh for reclimit system test
(cherry picked from commit 2f962f7041)
2023-09-20 10:32:11 +02:00
Tom Krizek
697041ae93 Use prereq.sh for xfer system test
(cherry picked from commit 587129b4c0)
2023-09-20 10:32:11 +02:00
Tom Krizek
cefa09ada5 Use prereq.sh for statschannel system test
(cherry picked from commit 27281955af)
2023-09-20 10:32:11 +02:00
Tom Krizek
c0e4411961 Add prereq.sh scripts for system tests requiring perl mod DNS
prereq.sh mechanism for dependency detection is preferred since it works
for both legacy and pytest runner.

(cherry picked from commit 9cc821d42f)
2023-09-20 10:32:10 +02:00
Tom Krizek
ee849d2a0c Use proper perl interpreter in xfer system test
(cherry picked from commit f0493890cc)
2023-09-20 10:32:10 +02:00
Tom Krizek
76b5c07b8d Remove redundant dependency checks for system tests
Dependencies for these tests are already checked in prereq.sh - if the
dependencies are missing, these tests will be skipped. The extra
dependency check in Makefile.am is extraneous and only applied for the
legacy test runner.

(cherry picked from commit 807f67b1cd)
2023-09-20 10:32:10 +02:00
Tom Krizek
9d9f2dcda5 Fix pytest module detection for run.sh
To allow concurrent invocations of pytest, it is necessary to assign
ports properly to avoid conflicts. In order to do that, pytest needs to
know a complete list of all test modules.

When pytest is invoked from run.sh, the current working directory is the
system test directory. To properly detect other tests, the conftest.py
has to look in the bin/tests/system directory, rather than the current
working directory.

(cherry picked from commit d4502206a1)
2023-09-20 10:32:10 +02:00
Tom Krizek
b86a41780a Use pytest runner for make check
Make python & pytest required dependencies to run system tests and
invoke the pytest runner from the makefile.

(cherry picked from commit 56c1087304)
2023-09-20 10:32:05 +02:00
Tom Krizek
56e842bbf2 Rename allow-query pytest glue file
To conform with the expected naming convention, the pytest glue file for
the `allow-query` test should use underscore as the word separator in
the python file name: allow-query/tests_sh_allow_query.py

(cherry picked from commit c026a00696)
2023-09-19 14:56:21 +02:00
Tom Krizek
09a8dd2f5b Treat bin/tests/system/_common as non-temp directory
The _common directory is a special case directory which contains shared
files for other system test directories. Make sure it's tracked in git
and not deleted during temporary directory cleanup.

(cherry picked from commit 9e13c3dbcb)
2023-09-19 14:56:21 +02:00
Tom Krizek
f9e075175d Rename system test directory with common files to _common
The old name "common" clashes with the convention of system test
directory naming. It appears as a system test directory, but it only
contains helper files.

To reduce confusion and to allow automatic detection of issues with
possibly missing test files, rename the helper directory to "_common".
The leading underscore indicates the directory is different and the its
name can no longer be confused with regular system test directories.

(cherry picked from commit 168dba163c)
2023-09-19 14:56:12 +02:00
Mark Andrews
88f696de93 Check RRSIG covered type in negative cache entry
The covered type previously displayed as TYPE0 when it should
have reflected the records that was actually covered.

(cherry picked from commit 8ce359652a)
2023-09-18 15:51:44 +10:00
Michal Nowak
71441b782b Disable command tracing in statschannel system test
Command tracing was added recently via
525afc666a and makes the system test too
verbose.

(cherry picked from commit f0c37d861c)
2023-09-05 19:20:37 +02:00
Ondřej Surý
c9d6f0e400 Deprecate 'dnssec-must-be-secure' option
The dnssec-must-be-secure feature was added in the early days of BIND 9
and DNSSEC and it makes sense only as a debugging feature.

Remove the feature to simplify the code.

(cherry picked from commit 9e0b348a2b)
2023-09-04 17:27:14 +02:00
Mark Andrews
74f9d749bf Clear OpenSSL error stack when exiting
(cherry picked from commit eaedba6621)
2023-09-01 13:45:34 +10:00
Mark Andrews
b5b13771f2 Clear OpenSSL errors on EVP_PKEY_new failures
(cherry picked from commit 6df53cdb87)
2023-09-01 13:37:02 +10:00
Matthijs Mekking
804f4b8d5d Add serve-stale test settings after flush
Add a test case to ensure that after 'rndc flush', the serve-stale
settings are not reset.

(cherry picked from commit 0f593fd70a)
2023-08-31 11:12:59 +02:00
Mark Andrews
b4694e7551 Check that removal of nonexistent PTR and SRV records work
There was a bug in rr_exists that caused it to fail when the
name didn't exist in the zone.

(cherry picked from commit 2b7192c5be)
2023-08-30 10:05:08 +10:00
Tony Finch
525afc666a Parse statschannel Content-Length: more carefully
A negative or excessively large Content-Length could cause a crash
by making `INSIST(httpd->consume != 0)` fail.

(cherry picked from commit 26e10e8fb5)
2023-08-23 15:44:11 +02:00
Tom Krizek
764161d8cf Allow re-runs of rrl system test
The rrl system test has been unstable and producing false positive
results for years (GL #172). Allow the test to be re-run (once) to
reduce the noise it causes.

(cherry picked from commit 40289d5440)
2023-08-23 14:50:24 +02:00
Tom Krizek
ac465416f9 Allow re-runs of reclimit system test
The reclimit system test has been unstable and producing false positive
results for years (GL #1587). Allow the test to be re-run (once) to
reduce the noise it causes.

(cherry picked from commit 8c5833fe39)
2023-08-23 14:50:24 +02:00
Tom Krizek
83cde47734 Allow re-runs of qmin system test
The qmin test is inherently unstable. It fails quite often with failure
modes described in GL #904. Allow the pytest runner to re-run the test
up to 3 times to only detect a more persistent and reproducible failures
rather than random noise caused by the nature of the test.

(cherry picked from commit be2123a8e9)
2023-08-23 14:50:24 +02:00
Tom Krizek
0c5d718849 Disable loadtime check in statschannel test
It is better to disable the specific check that causes the test to fail
rather than mark the entire test as xfail, which can mask other issues
which the test is capable of detecting.

(cherry picked from commit 7522583b57)
2023-08-23 14:50:24 +02:00
Tom Krizek
71f96aa1e6 Clean up pytest .gitignore file
The _last_test_run entry was accidentally added in !8194. It came from a
work-in-progress version of the MR and was left there during a rebase.

(cherry picked from commit 1b3db25adf)
2023-08-23 14:50:24 +02:00
Tom Krizek
7a42a6b409 Skip checkds test on Python<3.7
checkds test requires the capture_output argument for subprocess.run()
which was added in Python 3.7.

(cherry picked from commit 0361233b3d)
2023-08-23 14:50:22 +02:00
Matthijs Mekking
a0a95fb997 Make nsupdate honor -v for SOA queries
nsupdate offers the switch -v to use TCP for update requests. But
before sending that update request nsupdate was using UDP connection
to gather the SOA for determining the zone if not given explicitly.

Only use TCP if not using the default servers, because the SOA
query lookup is a different server with different capabilities (and
usually not for the better of it).
2023-08-23 09:58:17 +02:00
Tom Krizek
ae18bc33c5 Compile system test binaries during make
Using check_PROGRAMS would postpone compiling the binaries needed by
system tests until `make check` would be called. Since it's preferable
to invoke pytest directly to run the system test suite, compile these
binaries without installing them during `make all` instead by using
noinst_PROGRAMS.

This removes the need to use TESTS= make -e check hack invoked from
pytest to work around this issue.

(cherry picked from commit 21980b43b8)
2023-08-22 15:40:44 +02:00
Michal Nowak
8738309e24 Drop the rndc "-t" option from shudown system test
BIND 9.18 rndc does not know about the "-t" option, that results in an
silent "invalid argument" error.

The "-t" option originally came with
184eddb595 (a backport from the main
branch).
2023-08-22 10:58:58 +02:00
Michal Nowak
c3cc8aa429 Mark test_send_timeout as flaky
In some cases, BIND is not fast enough to fill the send buffer and
manages to answer all queries, contrary to what the test expects.
Repeat the check up to 3 times to limit this test instability.

(cherry picked from commit 681b23c398)
2023-08-22 08:55:03 +02:00
Tom Krizek
71a9e152f1 Add custom flaky decorator to handle unstable tests
If the flaky plugin for pytest is available, use its decorator to
support re-running unstable tests. In case the package is missing,
execute the test as usual without attempts to re-run it in case of
failure.

This is mostly intended to increase the test stability in CI. Using a
custom decorator enables us to keep the flaky package as an optional
dependency.

(cherry picked from commit 5b703de733)
2023-08-22 08:55:03 +02:00
Tom Krizek
b6e522ad03 .gitignore temporary directories and symlinks in system test dir
(cherry picked from commit 355dc73391)
2023-08-21 16:07:30 +02:00
Tom Krizek
303de3e089 Add clean-local target to clean pytest runner artifacts
The command finds all directories in bin/tests/system which contain an
underscore. Underscore indicates either a temporary directory (_tmp_), a
symlink to test artifacts (TESTNAME_MODULENAME), or a python-related
cache. Using underscore for a system test name is invalid and a hyphen
must be used instead.

(cherry picked from commit d66ff81543)
2023-08-21 16:07:30 +02:00
Tom Krizek
4b3d0c0f46 Silence pylint's refactoring suggestions for system_test_dir()
While it'd be fairly easy to split the function up into smaller ones,
the readability wouldn't be improved in this case. Silence the
suggestions instead.

(cherry picked from commit 83ddca7690)
2023-08-21 16:07:30 +02:00
Tom Krizek
4f6ea4fa1b Improve tempdir logging for pytest runner
At the end of the test, display the symlink path to the artifact
directory in case it's preserved. Log the full tempdir name in debug
log.

(cherry picked from commit f91d0b13e8)
2023-08-21 16:07:30 +02:00
Tom Krizek
89e6d1bc26 Create symlinks to test artifacts for pytest runner
While temporary directories are useful for test execution to keep
everything clean, they are difficult to work with manually. Create a
symlink for each test artifact directory with a stable and predictable
path. The symlink always either points to the latest artifacts, or is
missing in case the last run succeeded.

Ensure these symlinked directories aren't detected as test suites by the
pytest runner.

(cherry picked from commit e1ca5c8071)
2023-08-21 16:07:28 +02:00
Tom Krizek
57b2966d0b Improve pytest message when sanitizer report is found
(cherry picked from commit b1a9d1fe25)
2023-08-21 15:16:53 +02:00
Mark Andrews
86b9e02600 Remove bind9.xsl.1, bind9.xsl.2 and bind9.xsl.3
(cherry picked from commit 7da47fd858)
2023-08-15 14:25:11 +10:00