Commit Graph

38193 Commits

Author SHA1 Message Date
Ondřej Surý
d9b8412f08 Add semantic patch to explicitly cast chars to unsigned for ctype.h
Add a semantic patch to catch all the places where we pass 'char' to the
<ctype.h> family of functions (isalpha() and friends, toupper(),
tolower()).  While it generally works because the way how these
functions are constructed in the libc, it's safer to do the explicit
cast.

(cherry picked from commit 5ec65ab5d0)
2023-09-22 17:01:18 +02:00
Michał Kępień
7ff22f5961 Merge branch 'mnowak/add-cve-ref-role-9.18' into 'bind-9.18'
[9.18] Add a Sphinx role for linking CVEs to the ISC Knowledgebase

See merge request isc-projects/bind9!8326
2023-09-21 12:37:29 +00:00
Michal Nowak
5477f97643 Add a Sphinx role for linking CVEs to the ISC Knowledgebase
The new :cve: Sphinx role takes a CVE number as an argument and creates
a hyperlink to the relevant ISC Knowledgebase document that might have
more up-to-date or verbose information than the relevant release note.
This makes reaching ISC Knowledgebase pages directly from the release
notes easier.

Make all CVE references in the release notes use the new Sphinx role.

(cherry picked from commit 41b857e567)
2023-09-21 14:24:24 +02:00
Michał Kępień
56ae3eba80 Merge branch 'michal/update-sphinx-and-sphinx_rtd_theme-9.18' into 'bind-9.18'
[9.18] Update Sphinx and sphinx_rtd_theme

See merge request isc-projects/bind9!8323
2023-09-20 15:25:01 +00:00
Michał Kępień
fa7fc9084f Update Sphinx and sphinx_rtd_theme
Update Sphinx-related Python packages to their current versions pulled
in by "pip install sphinx-rtd-theme" run in a fresh virtual environment.

(cherry picked from commit 2f879cdec3)
2023-09-20 17:21:50 +02:00
Michał Kępień
2f08b622bf Merge tag 'v9.18.19' into bind-9.18 2023-09-20 16:52:16 +02:00
Tom Krizek
9a97f6f70a Merge branch '4312-pytest-symlink-name-collision-9.18' into 'bind-9.18'
[9.18] Rename convenience symlink to pytest artifacts

See merge request isc-projects/bind9!8318
2023-09-20 14:36:27 +00:00
Tom Krizek
2ad197b37d Rename convenience symlink to pytest artifacts
The previous symlink name convention was prone to name collisions If a
system test contained both a shell test and a pytest module of the same
name (e.g. dnstap test has both tests.sh and tests_dnstap.py), then
these would have the same convenience symlink, which could cause test
setup issues as well as confusion when examining test artifacts.

Update the naming convention to include the full pytest module name.
This results in a slightly more verbose names for shell tests (e.g.
dnstap_sh_dnstap instead of the previous dnstap_dnstap), but it removes
the chance of a collision.

(cherry picked from commit fd13dfb097)
2023-09-20 16:04:40 +02:00
Tom Krizek
08647118ce Merge branch '4250-remove-legacy-runner-support-for-python-tests-9.18' into 'bind-9.18'
[9.18] remove support for running python system tests with legacy test runner

See merge request isc-projects/bind9!8317
2023-09-20 13:52:38 +00:00
Tom Krizek
a5eb779c94 Update system test runner doc with pytest glue files
Document that pytest requires a glue file for each shell tests in order
to detect it.

(cherry picked from commit d050843a30)
2023-09-20 14:51:49 +02:00
Tom Krizek
f318cc081b Add CHANGES note for [GL #4250]
(cherry picked from commit 363677bde7)
2023-09-20 14:51:47 +02:00
Tom Krizek
60c4356554 Use integers for ports fixtures in pytest
Reorganize individual port fixtures and re-use the ports fixture to
obtain their number. Store it as integer and only cast it to string when
setting it as environment variable.

(cherry picked from commit 8deb026748)
2023-09-20 14:51:05 +02:00
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
9759d8ee28 Merge branch '4262-make-check-pytest-9.18' into 'bind-9.18'
[9.18] Use pytest runner for make check

See merge request isc-projects/bind9!8316
2023-09-20 12:38:34 +00: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
20c8fab299 ci: make sure to use legacy test runner on EL7
EL7 doesn't have the required dependencies for the newer pytest runner.
Since make check now invokes the pytest runner, ensure that the legacy
runner will be used instead.
2023-09-20 13:45:32 +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
a4edb7db29 ci: switch OpenBSD job to use make check
Invoking pytest directly provides a better formatted output and more
flexibility. However, it's prudent to verify that `make check` keeps
working as expected. Use it in the OpenBSD job which isn't executed as
frequently and its output is of least concern.

(cherry picked from commit f1c631f448)
2023-09-20 10:33:42 +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
7509613408 Merge branch 'tkrizek/pytest-check-system-test-files-with-danger-9.18' into 'bind-9.18'
[9.18] enforce system test file and name conventions with danger CI

See merge request isc-projects/bind9!8311
2023-09-19 13:40:50 +00:00
Tom Krizek
b3a1288ed6 danger: check system test convetions for pytest runner
When adding a new system test, it might easy to forget to add the
required files for the pytest runner or break a naming convention. Add
danger checks to cover these cases.

(cherry picked from commit d1371267c6)
2023-09-19 14:59:39 +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
a5639e05b4 Merge branch '4314-dns_ncache_current-fails-to-set-covered-correctly-bind-9.18' into 'bind-9.18'
[9.18] Resolve "dns_ncache_current fails to set covered correctly"

See merge request isc-projects/bind9!8307
2023-09-18 06:40:27 +00:00
Mark Andrews
55baa49118 Add a CHANGES note for [GL #4314]
(cherry picked from commit 80298ade33)
2023-09-18 15:52:16 +10: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
Mark Andrews
933d03fc83 Correctly set the value of covered in dns_ncache_current
Fix the type and rdclass being passed to dns_rdata_tostruct so
that rrsig.covered is correctly set.

(cherry picked from commit 779980710c)
2023-09-18 15:51:44 +10:00
Arаm Sаrgsyаn
4e7f22a228 Merge branch 'aram/danger-ignore-length-warn-for-fixups-9.18' into 'bind-9.18'
[9.18] Don't warn about subject line length for the fixup commits (CI)

See merge request isc-projects/bind9!8302
2023-09-14 12:13:10 +00:00
Aram Sargsyan
43409d27e4 Don't warn about subject line length for the fixup commits
The fixup commits' subject line has a prefix which has its own
length, so warning about the exceeding length is not accurate.
Given that the fixup commits can not be merged, because they
cause a danger failure, it's safe to ignore the length check
for them.

(cherry picked from commit 3db2beef9f)
2023-09-14 11:24:00 +00:00
Arаm Sаrgsyаn
0c0f694a86 Merge branch '4299-cid-465168-null-pointer-dereference' into 'bind-9.18'
Resolve "CID 465168: Null pointer dereference in lib/ns/client.c"

See merge request isc-projects/bind9!8281
2023-09-14 11:22:58 +00:00
Aram Sargsyan
2a57c12922 Remove an unnecessary NULL-check
In the ns__client_put_cb() callback function the 'client->manager'
pointer is guaranteed to be non-NULL, because in ns__client_request(),
before setting up the callback, the ns__client_setup() function is
called for the 'client', which makes sure that 'client->manager' is set.

Removing the NULL-check resolves the following static analyzer warning:

    /lib/ns/client.c: 1675 in ns__client_put_cb()
    1669     		dns_message_puttemprdataset(client->message, &client->opt);
    1670     	}
    1671     	client_extendederror_reset(client);
    1672
    1673     	dns_message_detach(&client->message);
    1674
    >>>     CID 465168:  Null pointer dereferences  (REVERSE_INULL)
    >>>     Null-checking "client->manager" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    1675     	if (client->manager != NULL) {
    1676     		ns_clientmgr_detach(&client->manager);
    1677     	}
    1678
    1679     	/*
    1680     	 * Detaching the task must be done after unlinking from
2023-09-14 10:39:24 +00:00
Tom Krizek
e25643f019 Merge branch 'tkrizek/ci-test-binaries-compilation-9.18' into 'bind-9.18'
[9.18] ci: omit explicit command to compile test binaries

See merge request isc-projects/bind9!8295
2023-09-12 08:55:42 +00:00