Compare commits

..
Author SHA1 Message Date
Michal Nowak e6ded8ed5b Omit spurious string from unit test debugging efforts
When both 'broken' and 'failed' test cases appear in unit test output

...
===> Broken tests
lib/isc/tests/socket_test:main  ->  broken: Test case timed out  [300.022s]
===> Failed tests
lib/isc/tests/time_test:main  ->  failed: 2 of 6 tests failed  [0.006s]
===> Summary
...

spurious '===>' string gets matched, that results in the following
error:

  Usage error for command debug: '===>' is not a test case identifier (missing ':'?).

Following change makes sure the string is omitted.

I checked on FreeBSD and OpenBSD that the AWK construct is supported.
2020-01-08 15:20:26 +01:00
Ondřej Surý 3bce0c2c20 Merge branch '1525-inline-system-test-failed-need-to-wait-for-zone-to-be-loaded' into 'master'
Resolve "inline system test failed, need to wait for zone to be loaded."

Closes #1525

See merge request isc-projects/bind9!2796
2020-01-08 07:23:42 +00:00
Mark AndrewsandOndřej Surý 2dc4d72fa9 address some timing issues in inline system test 2020-01-08 08:23:03 +01:00
Ondřej Surý cd17b773b1 Merge branch '1513-inline-system-test-failed' into 'master'
Resolve "inline system test failed"

Closes #1513

See merge request isc-projects/bind9!2777
2020-01-08 07:17:47 +00:00
Mark AndrewsandOndřej Surý 13fa80ede8 Address timing issues in 'inline' system test.
"rndc signing -serial <value>" could take longer than a second to
complete.  Loop waiting for update to succeed.

For tests where "rndc signing -serial <value>" is supposed to not
succeed, repeatedly test that we don't get the new serial, then
test that we have the old value.  This should prevent false negatives.
2020-01-07 16:14:12 +01:00
Ondřej Surý e3d8732548 Merge branch '1467-xfer-test-suppress-zone-transfer-when-we-are-going-to-retry' into 'master'
Resolve "xfer test: suppress zone transfer when we are going to retry."

Closes #1467

See merge request isc-projects/bind9!2735
2020-01-07 13:56:35 +00:00
Mark AndrewsandOndřej Surý 05aa45c602 improve forensic logs
improve forensic logs by directing output to per sub-test named
files and reporting the sub-subtest number.
2020-01-07 14:23:48 +01:00
Mark AndrewsandOndřej Surý 9bd6720f58 suppress unnecessary zone transfer
suppressed unnecessary zone transfer in "test mapped zone with
out of zone data" sub-test.
2020-01-07 14:23:17 +01:00
Mark AndrewsandOndřej Surý 46982b414b Improve forensic logging in "testing basic zone transfer functionality"
Split the "testing basic zone transfer functionality" into primary and
secondary parts to improve forensic logging.
2020-01-07 14:23:08 +01:00
Matthijs Mekking 2c38dd5474 Merge branch 'copyrights-2020' into 'master'
Update copyrights 2020

See merge request isc-projects/bind9!2809
2020-01-06 17:53:09 +00:00
Matthijs Mekking 935a2ae33f Update copyrights 2020
Happy New Year!
2020-01-06 15:05:03 +01:00
Michal Nowak db9ad43294 Merge branch 'mnowak/get-the-backtraces-out-of-unit-test-coredumps' into 'master'
Gather debug info on broken unit tests

See merge request isc-projects/bind9!2699
2020-01-06 11:25:09 +00:00
Michal Nowak 6a94e6ba73 Gather debug info on broken unit tests 2020-01-06 11:25:09 +00:00
Michał Kępień fc0fe4c5a7 Merge branch 'michal/misc-doc-fixes' into 'master'
Miscellaneous documentation fixes

See merge request isc-projects/bind9!2800
2020-01-03 08:24:18 +00:00
Michał Kępień 56f388cae1 Fix minor CHANGES issues 2020-01-03 09:08:09 +01:00
Michał Kępień b2f3eaf188 Fix whitespace and punctuation in release notes 2020-01-03 09:08:09 +01:00
Michał Kępień 2d00143ab1 Prevent splitting GitLab identifiers across lines
GitLab issue and merge request numbers placed in release notes (in the
form of "#1234" for issues and "!5678" for merge requests) should not be
split across two lines.  Extend the shell pipeline generating
doc/arm/notes.txt with a sed invocation which prevents such splitting.
2020-01-03 09:08:09 +01:00
Evan Hunt 996c1d3727 Merge branch 'each-copyrights' into 'master'
update copyright year to 2020

See merge request isc-projects/bind9!2801
2020-01-03 05:53:01 +00:00
Evan Hunt 2df13f79ef update copyright year to 2020 2020-01-02 21:45:30 -08:00
Mark Andrews 993633ad96 Merge branch '1530-lib-dns-gen-c-29-26-fatal-error-isc-platform-h-no-such-file-or-directory' into 'master'
Resolve "lib/dns/gen.c:29:26: fatal error: isc/platform.h: No such file or directory"

Closes #1530

See merge request isc-projects/bind9!2792
2019-12-22 21:18:09 +00:00
Mark Andrews 848c1c8b8b remove duplicate #includes 2019-12-23 07:47:36 +11:00
Mark Andrews 7278f2529a revert d10fbdec for lib/dns/gen.c as it is a build platform executable 2019-12-23 07:37:13 +11:00
Mark Andrews 39780ae54f Merge branch '1501-summary-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_rwlock_wrlock' into 'master'
Resolve "SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock - zone_postload"

See merge request isc-projects/bind9!2776
2019-12-20 10:57:43 +00:00
Mark Andrews d26e125438 Refactor loop body as copy_non_dnssec_records. 2019-12-20 21:31:23 +11:00
Ondřej SurýandMark Andrews bff83b9480 Add failure handling when iterators don't end with ISC_R_NOMORE 2019-12-20 21:31:23 +11:00
Ondřej SurýandMark Andrews 6012479419 Refactor receive_secure_db to make the variables and code flow around the iterator more local 2019-12-20 21:31:23 +11:00
Mark Andrews 9d8f9cc8f2 Call dns_dbiterator_destroy earlier to prevent potential deadlock. 2019-12-20 21:31:23 +11:00
Mark Andrews dafb1eb8bb Merge branch '1523-pkcs11-destroy-s-usage-message-is-misleading' into 'master'
Resolve "pkcs11-destroy's usage message is misleading"

Closes #1523

See merge request isc-projects/bind9!2785
2019-12-20 08:56:11 +00:00
Mark Andrews 41d827893e update usage message 2019-12-20 08:28:37 +00:00
Mark Andrews 3352a38da4 Merge branch '1418-threadsanitizer-data-race-dig-c-2542-in-main' into 'master'
Resolve "ThreadSanitizer: data race dig.c:2542 in main"

Closes #1418

See merge request isc-projects/bind9!2647
2019-12-20 05:57:50 +00:00
Ondřej SurýandMark Andrews b218bf5227 Fix the concurrent access to batchname in dig.c 2019-12-20 03:43:04 +00:00
Mark Andrews f8ec2140be Merge branch 'feature/master/maxminddb-version' into 'master'
Include maxminddb and protobuf version in named -V

See merge request isc-projects/bind9!2686
2019-12-17 23:58:31 +00:00
Mark Andrews 2f2bc03b2d add CHANGES 2019-12-18 10:57:25 +11:00
Petr MenšíkandMark Andrews 85f3476894 Include protobuf-c version
Include used version of protobuf-c in version info, both link time and
runtime version is available.
2019-12-17 23:46:52 +00:00
Petr MenšíkandMark Andrews e6d7384c0d Provide GeoIP2 library version in version
Libmaxmind does not provide any version macro for link time version.
Print at least runtime version library used, if linked.
2019-12-17 23:46:52 +00:00
Mark Andrews 0b7339ac6e Merge branch '1482-autosign-system-test-failed' into 'master'
Resolve "autosign system test failed"

Closes #1461 and #1482

See merge request isc-projects/bind9!2773
2019-12-13 08:58:14 +00:00
Mark Andrews 17d25dbf47 Fix autosign system test issues.
* report when NSEC3PARAM is not yet present
* allow more time for NSEC3PARAM to become present
* adjust frequency failure message
2019-12-13 08:31:56 +00:00
Ondřej Surý c2421a1ec3 Merge branch '1414-threadsanitizer-data-race-task-c-367-in-task_shutdown-v9_14+' into 'master'
Convert task->flags to C11 atomics

Closes #1414

See merge request isc-projects/bind9!2768
2019-12-13 07:41:53 +00:00
Ondřej Surý 5746172da3 Convert task flags to C11 atomics 2019-12-13 07:10:25 +01:00
56 changed files with 2925 additions and 2729 deletions
+7
View File
@@ -23,6 +23,9 @@ variables:
CFLAGS_COMMON: -fno-omit-frame-pointer -fno-optimize-sibling-calls -O1 -g -Wall -Wextra
# Pass run-time flags to AddressSanitizer to get core dumps on error.
ASAN_OPTIONS_COMMON: abort_on_error=1:disable_coredump=0:unmap_shadow_on_exit=1
TARBALL_COMPRESSOR: xz
TARBALL_EXTENSION: xz
@@ -805,6 +808,8 @@ asan:sid:amd64:
<<: *build_job
system:asan:sid:amd64:
variables:
ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
<<: *debian_sid_amd64_image
<<: *system_test_job
dependencies:
@@ -812,6 +817,8 @@ system:asan:sid:amd64:
needs: ["asan:sid:amd64"]
unit:asan:sid:amd64:
variables:
ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
+6 -3
View File
@@ -1,3 +1,6 @@
5337. [func] 'named -V' now reports maxminddb and protobuf-c
versions. [GL !2686]
--- 9.15.7 released ---
5336. [bug] The TCP high-water statistic could report an
@@ -6,13 +9,13 @@
5335. [func] Make TCP listening code multithreaded. [GL !2659]
5334. [doc] Update documentation with dnssec-policy clarifications.
Also change some defaults.
Also change some defaults. [GL !2711]
5333. [bug] Fix duration printing on Solaris when value is not
an ISO 8601 duration. [GL #1460]
5332. [func] Renamed "dnssec-keys" configuration statement
to the more descriptive "trust-anchors".
to the more descriptive "trust-anchors". [GL !2702]
5331. [func] Use compiler-provided mechanisms for thread local
storage, and make the requirement for such mechanisms
@@ -31,7 +34,7 @@
dropped because the recursive-clients quota was
exceeded. [GL #1399]
5326. [bug] Add python dependancy on 'distutils.core' to configure.
5326. [bug] Add Python dependency on 'distutils.core' to configure.
'distutils.core' is required for installation.
[GL #1397]
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (C) 1996-2019 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 1996-2020 Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
+1
View File
@@ -41,6 +41,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -44,6 +44,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -38,6 +38,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -45,6 +45,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -40,6 +40,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+16 -13
View File
@@ -54,7 +54,7 @@
dig_lookup_t *default_lookup = NULL;
static char *batchname = NULL;
static atomic_uintptr_t batchname = ATOMIC_VAR_INIT(0);
static FILE *batchfp = NULL;
static char *argv0;
static int addresscount = 0;
@@ -1874,7 +1874,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
value);
return (value_from_next);
case 'f':
batchname = value;
atomic_store(&batchname, (uintptr_t)value);
return (value_from_next);
case 'k':
strlcpy(keyfile, value, sizeof(keyfile));
@@ -2327,13 +2327,15 @@ parse_args(bool is_batchfile, bool config_only,
* first entry, then trust the callback in dighost_shutdown
* to get the rest
*/
if ((batchname != NULL) && !(is_batchfile)) {
if (strcmp(batchname, "-") == 0)
char *filename = (char *)atomic_load(&batchname);
if ((filename != NULL) && !(is_batchfile)) {
if (strcmp(filename, "-") == 0) {
batchfp = stdin;
else
batchfp = fopen(batchname, "r");
} else {
batchfp = fopen(filename, "r");
}
if (batchfp == NULL) {
perror(batchname);
perror(filename);
if (exitcode < 8)
exitcode = 8;
fatal("couldn't open specified batch file");
@@ -2388,14 +2390,14 @@ query_finished(void) {
int bargc;
char *bargv[16];
if (batchname == NULL) {
if (atomic_load(&batchname) == 0) {
isc_app_shutdown();
return;
}
fflush(stdout);
if (feof(batchfp)) {
batchname = NULL;
atomic_store(&batchname, 0);
isc_app_shutdown();
if (batchfp != stdin)
fclose(batchfp);
@@ -2409,7 +2411,7 @@ query_finished(void) {
parse_args(true, false, bargc, (char **)bargv);
start_lookup();
} else {
batchname = NULL;
atomic_store(&batchname, 0);
if (batchfp != stdin)
fclose(batchfp);
isc_app_shutdown();
@@ -2539,10 +2541,11 @@ void dig_query_start()
void
dig_shutdown() {
destroy_lookup(default_lookup);
if (batchname != NULL) {
if (batchfp != stdin)
if (atomic_load(&batchname) != 0) {
if (batchfp != stdin) {
fclose(batchfp);
batchname = NULL;
}
atomic_store(&batchname, 0);
}
cancel_all();
destroy_libs();
+1
View File
@@ -53,6 +53,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -48,6 +48,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -72,6 +72,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -41,6 +41,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -42,6 +42,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -39,6 +39,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -44,6 +44,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -51,6 +51,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -39,6 +39,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -41,6 +41,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -51,6 +51,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -38,6 +38,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+15
View File
@@ -59,6 +59,10 @@
#include <json_c_version.h>
#endif /* HAVE_JSON_C */
#ifdef HAVE_GEOIP2
#include <maxminddb.h>
#endif
/*
* Defining NAMED_MAIN provides storage declarations (rather than extern)
* for variables in named/globals.h.
@@ -548,6 +552,17 @@ OPENSSL_VERSION_NUMBER >= 0x10100000L /* 1.1.0 or higher */
ZLIB_VERSION);
printf("linked to zlib version: %s\n",
zlibVersion());
#endif
#if defined(HAVE_GEOIP2)
/* Unfortunately, no version define on link time */
printf("linked to maxminddb version: %s\n",
MMDB_lib_version());
#endif
#if defined(HAVE_DNSTAP)
printf("compiled with protobuf-c version: %s\n",
PROTOBUF_C_VERSION);
printf("linked to protobuf-c version: %s\n",
protobuf_c_version());
#endif
printf("threads support is enabled\n\n");
+1
View File
@@ -49,6 +49,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -49,6 +49,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -50,6 +50,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1 -1
View File
@@ -124,7 +124,7 @@ main(int argc, char *argv[]) {
if (errflg || (id && (label != NULL))) {
fprintf(stderr, "Usage:\n");
fprintf(stderr, "\tpkcs11-destroy [-m module] [-s slot] "
"[-i id | -l label] [-p pin] [-w waittime]\n");
"{-i id | -l label} [-p pin] [-w waittime]\n");
exit(1);
}
+1
View File
@@ -38,6 +38,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -39,6 +39,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -38,6 +38,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -37,6 +37,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -33,6 +33,7 @@
<copyright>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -40,6 +40,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -38,6 +38,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -35,6 +35,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -43,6 +43,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -44,6 +44,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+10
View File
@@ -1,4 +1,14 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
if [ -n "${SOFTHSM2_CONF}" ] && command -v softhsm2-util >/dev/null; then
SOFTHSM2_DIR=$(dirname "$SOFTHSM2_CONF")
mkdir -p "${SOFTHSM2_DIR}/tokens"
+10 -3
View File
@@ -117,8 +117,12 @@ checkjitter () {
echo_i "checking whether all frequencies fall into <$_low;$_high> range"
for _num in $_expiretimes
do
if [ $_num -gt $_high ] || [ $_num -lt $_low ]; then
echo_i "error: too many RRSIG records ($_num) with the same expiration time"
if [ $_num -gt $_high ]; then
echo_i "error: too many RRSIG records ($_num) in expiration bucket"
_ret=1
fi
if [ $_num -lt $_low ]; then
echo_i "error: too few RRSIG records ($_num) in expiration bucket"
_ret=1
fi
done
@@ -1051,7 +1055,10 @@ check_if_nsec3param_exists() {
$DIG $DIGOPTS NSEC3PARAM jitter.nsec3.example @10.53.0.3 > dig.out.ns3.1.test$n || return 1
grep -q "^jitter\.nsec3\.example\..*NSEC3PARAM" dig.out.ns3.1.test$n || return 1
}
retry_quiet 20 check_if_nsec3param_exists || ret=1
retry_quiet 40 check_if_nsec3param_exists || {
echo_i "error: NSEC3PARAM not present yet"
ret=1
}
$DIG $DIGOPTS AXFR jitter.nsec3.example @10.53.0.3 > dig.out.ns3.2.test$n || ret=1
# Check jitter distribution.
checkjitter dig.out.ns3.2.test$n || ret=1
+20 -32
View File
@@ -15,6 +15,12 @@ SYSTEMTESTTOP=..
DIGOPTS="+tcp +dnssec -p ${PORT}"
RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
wait_for_serial() (
$DIG $DIGOPTS "@$1" "$2" SOA > "$4"
serial=$(awk '$4 == "SOA" { print $7 }' "$4")
[ "$3" -eq "${serial:--1}" ]
)
status=0
n=0
@@ -1014,10 +1020,7 @@ ret=0
$DIG $DIGOPTS nsec3. SOA @10.53.0.3 > dig.out.n3.pre.test$n
newserial=`$PERL -e 'while (<>) { chomp; my @field = split /\s+/; printf("%u\n", $field[6] + 10) if ($field[3] eq "SOA"); }' < dig.out.n3.pre.test$n`
$RNDCCMD 10.53.0.3 signing -serial ${newserial:-0} nsec3 > /dev/null 2>&1
sleep 1
$DIG $DIGOPTS nsec3. SOA @10.53.0.3 > dig.out.ns3.post.test$n
serial=`awk '$4 == "SOA" { print $7 }' dig.out.ns3.post.test$n`
[ ${newserial:-0} -eq ${serial:-1} ] || ret=1
retry_quiet 5 wait_for_serial 10.53.0.3 nsec3. "${newserial:-0}" dig.out.ns3.post.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -1047,10 +1050,7 @@ newserial=`$PERL -e 'while (<>) { chomp; my @field = split /\s+/; printf("%u\n",
$RNDCCMD 10.53.0.3 freeze nsec3 > /dev/null 2>&1
$RNDCCMD 10.53.0.3 signing -serial ${newserial:-0} nsec3 > /dev/null 2>&1
$RNDCCMD 10.53.0.3 thaw nsec3 > /dev/null 2>&1
sleep 1
$DIG $DIGOPTS nsec3. SOA @10.53.0.3 > dig.out.ns3.post.test$n
serial=`awk '$4 == "SOA" { print $7 }' dig.out.ns3.post.test$n`
[ ${newserial:-0} -eq ${serial:-1} ] || ret=1
retry_quiet 5 wait_for_serial 10.53.0.3 nsec3. "${newserial:-0}" dig.out.ns3.post1.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -1060,10 +1060,7 @@ ret=0
$DIG $DIGOPTS bits. SOA @10.53.0.2 > dig.out.ns2.pre.test$n
newserial=`$PERL -e 'while (<>) { chomp; my @field = split /\s+/; printf("%u\n", $field[6] + 10) if ($field[3] eq "SOA"); }' < dig.out.ns2.pre.test$n`
$RNDCCMD 10.53.0.2 signing -serial ${newserial:-0} bits > /dev/null 2>&1
sleep 1
$DIG $DIGOPTS bits. SOA @10.53.0.2 > dig.out.ns2.post.test$n
serial=`awk '$4 == "SOA" { print $7 }' dig.out.ns2.post.test$n`
[ ${newserial:-0} -eq ${serial:-1} ] || ret=1
retry_quiet 5 wait_for_serial 10.53.0.2 bits. "${newserial:-0}" dig.out.ns2.post.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -1074,10 +1071,8 @@ $DIG $DIGOPTS bits. SOA @10.53.0.2 > dig.out.ns2.pre.test$n
oldserial=`awk '$4 == "SOA" { print $7 }' dig.out.ns2.pre.test$n`
newserial=`$PERL -e 'while (<>) { chomp; my @field = split /\s+/; printf("%u\n", $field[6] - 10) if ($field[3] eq "SOA"); }' < dig.out.ns2.pre.test$n`
$RNDCCMD 10.53.0.2 signing -serial ${newserial:-0} bits > /dev/null 2>&1
sleep 1
$DIG $DIGOPTS bits. SOA @10.53.0.2 > dig.out.ns2.post.test$n
serial=`awk '$4 == "SOA" { print $7 }' dig.out.ns2.post.test$n`
[ ${oldserial:-0} -eq ${serial:-1} ] || ret=1
retry_quiet 5 wait_for_serial 10.53.0.2 bits. "${newserial:-1}" dig.out.ns2.post1.test$n && ret=1
retry_quiet 5 wait_for_serial 10.53.0.2 bits. "${oldserial:-1}" dig.out.ns2.post2.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -1090,10 +1085,8 @@ newserial=`$PERL -e 'while (<>) { chomp; my @field = split /\s+/; printf("%u\n",
$RNDCCMD 10.53.0.2 freeze bits > /dev/null 2>&1
$RNDCCMD 10.53.0.2 signing -serial ${newserial:-0} bits > /dev/null 2>&1
$RNDCCMD 10.53.0.2 thaw bits > /dev/null 2>&1
sleep 1
$DIG $DIGOPTS bits. SOA @10.53.0.2 > dig.out.ns2.post.test$n
serial=`awk '$4 == "SOA" { print $7 }' dig.out.ns2.post.test$n`
[ ${oldserial:-0} -eq ${serial:-1} ] || ret=1
retry_quiet 5 wait_for_serial 10.53.0.2 bits. "${newserial:-1}" dig.out.ns2.post1.test$n && ret=1
retry_quiet 5 wait_for_serial 10.53.0.2 bits. "${oldserial:-1}" dig.out.ns2.post2.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -1339,18 +1332,12 @@ ret=0
mv Kdelayedkeys* ns3/
$RNDCCMD 10.53.0.3 loadkeys delayedkeys > rndc.out.ns3.pre.test$n 2>&1 || ret=1
# Wait until the zone is signed.
ans=1
for i in 1 2 3 4 5 6 7 8 9 10
do
$RNDCCMD 10.53.0.3 signing -list delayedkeys > signing.out.test$n 2>&1
num=`grep "Done signing with" signing.out.test$n | wc -l`
if [ $num -eq 2 ]; then
ans=0
break
fi
sleep 1
done
if [ $ans != 0 ]; then ret=1; fi
check_done_signing () (
$RNDCCMD 10.53.0.3 signing -list delayedkeys > signing.out.test$n 2>&1
num=`grep "Done signing with" signing.out.test$n | wc -l`
[ $num -eq 2 ]
)
retry_quiet 10 check_done_signing || ret=1
# Halt rather than stopping the server to prevent the master file from being
# flushed upon shutdown since we specifically want to avoid it.
$PERL $SYSTEMTESTTOP/stop.pl --use-rndc --halt --port ${CONTROLPORT} inline ns3
@@ -1369,6 +1356,7 @@ $PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} inline ns3
# unless the records contained in it were scheduled for resigning, no resigning
# event will be scheduled at all since the secure zone master file contains no
# DNSSEC records.
wait_for_log 20 "all zones loaded" ns3/named.run || ret=1
$RNDCCMD 10.53.0.3 zonestatus delayedkeys > rndc.out.ns3.post.test$n 2>&1 || ret=1
grep "next resign node:" rndc.out.ns3.post.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
+140 -130
View File
@@ -18,11 +18,41 @@ RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
status=0
n=0
n=`expr $n + 1`
echo_i "testing basic zone transfer functionality"
n=$((n+1))
echo_i "testing basic zone transfer functionality (from primary) ($n)"
tmp=0
$DIG $DIGOPTS example. \
@10.53.0.2 axfr > dig.out.ns2 || status=1
grep "^;" dig.out.ns2 | cat_i
@10.53.0.2 axfr > dig.out.ns2.test$n || tmp=1
grep "^;" dig.out.ns2.test$n | cat_i
digcomp dig1.good dig.out.ns2.test$n || tmp=1
if test $tmp != 0 ; then echo_i "failed"; fi
status=$((status+tmp))
n=$((n+1))
echo_i "testing basic zone transfer functionality (from secondary) ($n)"
#
# Spin to allow the zone to tranfer.
#
for i in 1 2 3 4 5
do
tmp=0
$DIG $DIGOPTS example. \
@10.53.0.3 axfr > dig.out.ns3.test$n || tmp=1
grep "^;" dig.out.ns3.test$n > /dev/null || break
echo_i "plain zone re-transfer"
sleep 5
done
grep "^;" dig.out.ns3.test$n | cat_i
digcomp dig1.good dig.out.ns3.test$n || tmp=1
if test $tmp != 0 ; then echo_i "failed"; fi
status=$((status+tmp))
n=$((n+1))
echo_i "testing TSIG signed zone transfers ($n)"
$DIG $DIGOPTS tsigzone. @10.53.0.2 axfr -y tsigzone.:1234abcd8765 > dig.out.ns2.test$n || status=1
grep "^;" dig.out.ns2.test$n | cat_i
#
# Spin to allow the zone to tranfer.
@@ -30,41 +60,16 @@ grep "^;" dig.out.ns2 | cat_i
for i in 1 2 3 4 5
do
tmp=0
$DIG $DIGOPTS example. \
@10.53.0.3 axfr > dig.out.ns3 || tmp=1
grep "^;" dig.out.ns3 > /dev/null
$DIG $DIGOPTS tsigzone. @10.53.0.3 axfr -y tsigzone.:1234abcd8765 > dig.out.ns3.test$n || tmp=1
grep "^;" dig.out.ns3.test$n > /dev/null
if test $? -ne 0 ; then break; fi
echo_i "plain zone re-transfer"
sleep 5
done
if test $tmp -eq 1 ; then status=1; fi
grep "^;" dig.out.ns3 | cat_i
grep "^;" dig.out.ns3.test$n | cat_i
digcomp dig1.good dig.out.ns2 || status=1
digcomp dig1.good dig.out.ns3 || status=1
n=`expr $n + 1`
echo_i "testing TSIG signed zone transfers"
$DIG $DIGOPTS tsigzone. @10.53.0.2 axfr -y tsigzone.:1234abcd8765 > dig.out.ns2 || status=1
grep "^;" dig.out.ns2 | cat_i
#
# Spin to allow the zone to tranfer.
#
for i in 1 2 3 4 5
do
tmp=0
$DIG $DIGOPTS tsigzone. @10.53.0.3 axfr -y tsigzone.:1234abcd8765 > dig.out.ns3 || tmp=1
grep "^;" dig.out.ns3 > /dev/null
if test $? -ne 0 ; then break; fi
echo_i "plain zone re-transfer"
sleep 5
done
if test $tmp -eq 1 ; then status=1; fi
grep "^;" dig.out.ns3 | cat_i
digcomp dig.out.ns2 dig.out.ns3 || status=1
digcomp dig.out.ns2.test$n dig.out.ns3.test$n || status=1
echo_i "reload servers for in preparation for ixfr-from-differences tests"
@@ -108,28 +113,29 @@ rndc_reload ns7 10.53.0.7
sleep 3
echo_i "testing zone is dumped after successful transfer"
n=$((n+1))
echo_i "testing zone is dumped after successful transfer ($n)"
$DIG $DIGOPTS +noall +answer +multi @10.53.0.2 \
slave. soa > dig.out.ns2 || tmp=1
grep "1397051952 ; serial" dig.out.ns2 > /dev/null 2>&1 || tmp=1
slave. soa > dig.out.ns2.test$n || tmp=1
grep "1397051952 ; serial" dig.out.ns2.test$n > /dev/null 2>&1 || tmp=1
grep "1397051952 ; serial" ns2/slave.db > /dev/null 2>&1 || tmp=1
if test $tmp != 0 ; then echo_i "failed"; fi
status=`expr $status + $tmp`
status=$((status+tmp))
n=`expr $n + 1`
echo_i "testing ixfr-from-differences yes;"
n=$((n+1))
echo_i "testing ixfr-from-differences yes; ($n)"
tmp=0
for i in 0 1 2 3 4 5 6 7 8 9
do
a=0 b=0 c=0 d=0
echo_i "wait for reloads..."
$DIG $DIGOPTS @10.53.0.6 +noall +answer soa master > dig.out.soa1.ns6
grep "1397051953" dig.out.soa1.ns6 > /dev/null && a=1
$DIG $DIGOPTS @10.53.0.1 +noall +answer soa slave > dig.out.soa2.ns1
grep "1397051953" dig.out.soa2.ns1 > /dev/null && b=1
$DIG $DIGOPTS @10.53.0.2 +noall +answer soa example > dig.out.soa3.ns2
grep "1397051953" dig.out.soa3.ns2 > /dev/null && c=1
$DIG $DIGOPTS @10.53.0.6 +noall +answer soa master > dig.out.soa1.ns6.test$n
grep "1397051953" dig.out.soa1.ns6.test$n > /dev/null && a=1
$DIG $DIGOPTS @10.53.0.1 +noall +answer soa slave > dig.out.soa2.ns1.test$n
grep "1397051953" dig.out.soa2.ns1.test$n > /dev/null && b=1
$DIG $DIGOPTS @10.53.0.2 +noall +answer soa example > dig.out.soa3.ns2.test$n
grep "1397051953" dig.out.soa3.ns2.test$n > /dev/null && c=1
[ $a -eq 1 -a $b -eq 1 -a $c -eq 1 ] && break
sleep 2
done
@@ -138,12 +144,12 @@ for i in 0 1 2 3 4 5 6 7 8 9
do
a=0 b=0 c=0 d=0
echo_i "wait for transfers..."
$DIG $DIGOPTS @10.53.0.3 +noall +answer soa example > dig.out.soa1.ns3
grep "1397051953" dig.out.soa1.ns3 > /dev/null && a=1
$DIG $DIGOPTS @10.53.0.3 +noall +answer soa master > dig.out.soa2.ns3
grep "1397051953" dig.out.soa2.ns3 > /dev/null && b=1
$DIG $DIGOPTS @10.53.0.6 +noall +answer soa slave > dig.out.soa3.ns6
grep "1397051953" dig.out.soa3.ns6 > /dev/null && c=1
$DIG $DIGOPTS @10.53.0.3 +noall +answer soa example > dig.out.soa1.ns3.test$n
grep "1397051953" dig.out.soa1.ns3.test$n > /dev/null && a=1
$DIG $DIGOPTS @10.53.0.3 +noall +answer soa master > dig.out.soa2.ns3.test$n
grep "1397051953" dig.out.soa2.ns3.test$n > /dev/null && b=1
$DIG $DIGOPTS @10.53.0.6 +noall +answer soa slave > dig.out.soa3.ns6.test$n
grep "1397051953" dig.out.soa3.ns6.test$n > /dev/null && c=1
[ $a -eq 1 -a $b -eq 1 -a $c -eq 1 ] && break
# re-notify if necessary
@@ -154,62 +160,62 @@ do
done
$DIG $DIGOPTS example. \
@10.53.0.3 axfr > dig.out.ns3 || tmp=1
grep "^;" dig.out.ns3 | cat_i
@10.53.0.3 axfr > dig.out.ns3.test$n || tmp=1
grep "^;" dig.out.ns3.test$n | cat_i
digcomp dig2.good dig.out.ns3 || tmp=1
digcomp dig2.good dig.out.ns3.test$n || tmp=1
# ns3 has a journal iff it received an IXFR.
test -f ns3/example.bk || tmp=1
test -f ns3/example.bk.jnl || tmp=1
if test $tmp != 0 ; then echo_i "failed"; fi
status=`expr $status + $tmp`
status=$((status+tmp))
n=`expr $n + 1`
echo_i "testing ixfr-from-differences master; (master zone)"
n=$((n+1))
echo_i "testing ixfr-from-differences master; (master zone) ($n)"
tmp=0
$DIG $DIGOPTS master. \
@10.53.0.6 axfr > dig.out.ns6 || tmp=1
grep "^;" dig.out.ns6 | cat_i
@10.53.0.6 axfr > dig.out.ns6.test$n || tmp=1
grep "^;" dig.out.ns6.test$n | cat_i
$DIG $DIGOPTS master. \
@10.53.0.3 axfr > dig.out.ns3 || tmp=1
grep "^;" dig.out.ns3 > /dev/null && cat_i dig.out.ns3
@10.53.0.3 axfr > dig.out.ns3.test$n || tmp=1
grep "^;" dig.out.ns3.test$n > /dev/null && cat_i dig.out.ns3.test$n
digcomp dig.out.ns6 dig.out.ns3 || tmp=1
digcomp dig.out.ns6.test$n dig.out.ns3.test$n || tmp=1
# ns3 has a journal iff it received an IXFR.
test -f ns3/master.bk || tmp=1
test -f ns3/master.bk.jnl || tmp=1
if test $tmp != 0 ; then echo_i "failed"; fi
status=`expr $status + $tmp`
status=$((status+tmp))
n=`expr $n + 1`
echo_i "testing ixfr-from-differences master; (slave zone)"
n=$((n+1))
echo_i "testing ixfr-from-differences master; (slave zone) ($n)"
tmp=0
$DIG $DIGOPTS slave. \
@10.53.0.6 axfr > dig.out.ns6 || tmp=1
grep "^;" dig.out.ns6 | cat_i
@10.53.0.6 axfr > dig.out.ns6.test$n || tmp=1
grep "^;" dig.out.ns6.test$n | cat_i
$DIG $DIGOPTS slave. \
@10.53.0.1 axfr > dig.out.ns1 || tmp=1
grep "^;" dig.out.ns1 | cat_i
@10.53.0.1 axfr > dig.out.ns1.test$n || tmp=1
grep "^;" dig.out.ns1.test$n | cat_i
digcomp dig.out.ns6 dig.out.ns1 || tmp=1
digcomp dig.out.ns6.test$n dig.out.ns1.test$n || tmp=1
# ns6 has a journal iff it received an IXFR.
test -f ns6/slave.bk || tmp=1
test -f ns6/slave.bk.jnl && tmp=1
if test $tmp != 0 ; then echo_i "failed"; fi
status=`expr $status + $tmp`
status=$((status+tmp))
n=`expr $n + 1`
echo_i "testing ixfr-from-differences slave; (master zone)"
n=$((n+1))
echo_i "testing ixfr-from-differences slave; (master zone) ($n)"
tmp=0
# ns7 has a journal iff it generates an IXFR.
@@ -217,35 +223,36 @@ test -f ns7/master2.db || tmp=1
test -f ns7/master2.db.jnl && tmp=1
if test $tmp != 0 ; then echo_i "failed"; fi
status=`expr $status + $tmp`
status=$((status+tmp))
n=`expr $n + 1`
echo_i "testing ixfr-from-differences slave; (slave zone)"
n=$((n+1))
echo_i "testing ixfr-from-differences slave; (slave zone) ($n)"
tmp=0
$DIG $DIGOPTS slave. \
@10.53.0.1 axfr > dig.out.ns1 || tmp=1
grep "^;" dig.out.ns1 | cat_i
@10.53.0.1 axfr > dig.out.ns1.test$n || tmp=1
grep "^;" dig.out.ns1.test$n | cat_i
$DIG $DIGOPTS slave. \
@10.53.0.7 axfr > dig.out.ns7 || tmp=1
grep "^;" dig.out.ns1 | cat_i
@10.53.0.7 axfr > dig.out.ns7.test$n || tmp=1
grep "^;" dig.out.ns7.test$n | cat_i
digcomp dig.out.ns7 dig.out.ns1 || tmp=1
digcomp dig.out.ns7.test$n dig.out.ns1.test$n || tmp=1
# ns7 has a journal iff it generates an IXFR.
test -f ns7/slave.bk || tmp=1
test -f ns7/slave.bk.jnl || tmp=1
if test $tmp != 0 ; then echo_i "failed"; fi
status=`expr $status + $tmp`
status=$((status+tmp))
echo_i "check that a multi-message uncompressable zone transfers"
n=$((n+1))
echo_i "check that a multi-message uncompressable zone transfers ($n)"
$DIG axfr . -p ${PORT} @10.53.0.4 | grep SOA > axfr.out
if test `wc -l < axfr.out` != 2
then
echo_i "failed"
status=`expr $status + 1`
status=$((status+1))
fi
# now we test transfers with assorted TSIG glitches
@@ -276,20 +283,20 @@ rndc_reload ns4 10.53.0.4
for i in 0 1 2 3 4 5 6 7 8 9
do
$DIGCMD nil. SOA > dig.out.ns4
grep SOA dig.out.ns4 > /dev/null && break
$DIGCMD nil. SOA > dig.out.ns4.test$n
grep SOA dig.out.ns4.test$n > /dev/null && break
sleep 1
done
sed -n "$cur,\$p" < ns4/named.run | grep "Transfer status: success" > /dev/null || {
echo_i "failed: expected status was not logged"
status=1
status=$((status+1))
}
cur=`awk 'END {print NR}' ns4/named.run`
$DIGCMD nil. TXT | grep 'initial AXFR' >/dev/null || {
echo_i "failed"
status=1
status=$((status+1))
}
echo_i "unsigned transfer"
@@ -303,13 +310,13 @@ sleep 2
sed -n "$cur,\$p" < ns4/named.run | grep "Transfer status: expected a TSIG or SIG(0)" > /dev/null || {
echo_i "failed: expected status was not logged"
status=1
status=$((status+1))
}
cur=`awk 'END {print NR}' ns4/named.run`
$DIGCMD nil. TXT | grep 'unsigned AXFR' >/dev/null && {
echo_i "failed"
status=1
status=$((status+1))
}
echo_i "bad keydata"
@@ -323,13 +330,13 @@ sleep 2
sed -n "$cur,\$p" < ns4/named.run | grep "Transfer status: tsig verify failure" > /dev/null || {
echo_i "failed: expected status was not logged"
status=1
status=$((status+1))
}
cur=`awk 'END {print NR}' ns4/named.run`
$DIGCMD nil. TXT | grep 'bad keydata AXFR' >/dev/null && {
echo_i "failed"
status=1
status=$((status+1))
}
echo_i "partially-signed transfer"
@@ -343,13 +350,13 @@ sleep 2
sed -n "$cur,\$p" < ns4/named.run | grep "Transfer status: expected a TSIG or SIG(0)" > /dev/null || {
echo_i "failed: expected status was not logged"
status=1
status=$((status+1))
}
cur=`awk 'END {print NR}' ns4/named.run`
$DIGCMD nil. TXT | grep 'partially signed AXFR' >/dev/null && {
echo_i "failed"
status=1
status=$((status+1))
}
echo_i "unknown key"
@@ -363,13 +370,13 @@ sleep 2
sed -n "$cur,\$p" < ns4/named.run | grep "tsig key 'tsig_key': key name and algorithm do not match" > /dev/null || {
echo_i "failed: expected status was not logged"
status=1
status=$((status+1))
}
cur=`awk 'END {print NR}' ns4/named.run`
$DIGCMD nil. TXT | grep 'unknown key AXFR' >/dev/null && {
echo_i "failed"
status=1
status=$((status+1))
}
echo_i "incorrect key"
@@ -383,16 +390,16 @@ sleep 2
sed -n "$cur,\$p" < ns4/named.run | grep "tsig key 'tsig_key': key name and algorithm do not match" > /dev/null || {
echo_i "failed: expected status was not logged"
status=1
status=$((status+1))
}
cur=`awk 'END {print NR}' ns4/named.run`
$DIGCMD nil. TXT | grep 'incorrect key AXFR' >/dev/null && {
echo_i "failed"
status=1
status=$((status+1))
}
n=`expr $n + 1`
n=$((n+1))
echo_i "check that we ask for and get a EDNS EXPIRE response ($n)"
# force a refresh query
$RNDCCMD 10.53.0.7 refresh edns-expire 2>&1 | sed 's/^/ns7 /' | cat_i
@@ -402,56 +409,59 @@ sleep 10
expire=`awk '/edns-expire\/IN: got EDNS EXPIRE of/ { x=$9 } END { print x }' ns7/named.run`
test ${expire:-0} -gt 0 -a ${expire:-0} -lt 1814400 || {
echo_i "failed (expire=${expire:-0})"
status=1
status=$((status+1))
}
n=`expr $n + 1`
n=$((n+1))
echo_i "test smaller transfer TCP message size ($n)"
$DIG $DIGOPTS example. @10.53.0.8 axfr \
-y key1.:1234abcd8765 > dig.out.msgsize || status=1
-y key1.:1234abcd8765 > dig.out.msgsize.test$n || status=1
$DOS2UNIX dig.out.msgsize >/dev/null 2>&1
$DOS2UNIX dig.out.msgsize.test$n >/dev/null 2>&1
bytes=`wc -c < dig.out.msgsize`
bytes=`wc -c < dig.out.msgsize.test$n`
if [ $bytes -ne 459357 ]; then
echo_i "failed axfr size check"
status=1
status=$((status+1))
fi
num_messages=`cat ns8/named.run | grep "sending TCP message of" | wc -l`
if [ $num_messages -le 300 ]; then
echo_i "failed transfer message count check"
status=1
status=$((status+1))
fi
n=`expr $n + 1`
n=$((n+1))
echo_i "test mapped zone with out of zone data ($n)"
tmp=0
$DIG -p ${PORT} txt mapped @10.53.0.3 > dig.out.1.$n
grep "status: NOERROR," dig.out.1.$n > /dev/null || tmp=1
$DIG -p ${PORT} txt mapped @10.53.0.3 > dig.out.1.test$n
grep "status: NOERROR," dig.out.1.test$n > /dev/null || tmp=1
$PERL $SYSTEMTESTTOP/stop.pl xfer ns3
$PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} xfer ns3
for try in 0 1 2 3 4 5 6 7 8 9; do
iret=0
$DIG -p ${PORT} txt mapped @10.53.0.3 > dig.out.2.$n
grep "status: NOERROR," dig.out.2.$n > /dev/null || iret=1
$DIG -p ${PORT} axfr mapped @10.53.0.3 > dig.out.3.$n
digcomp knowngood.mapped dig.out.3.$n || iret=1
$DIG -p ${PORT} txt mapped @10.53.0.3 > dig.out.2.test$n
grep "status: NOERROR," dig.out.2.test$n > /dev/null || iret=1
if [ "$iret" -eq 0 ]
then
$DIG -p ${PORT} axfr mapped @10.53.0.3 > dig.out.3.test$n
digcomp knowngood.mapped dig.out.3.test$n || iret=1
fi
[ "$iret" -eq 0 ] && break
sleep 1
done
[ "$iret" -eq 0 ] || tmp=1
[ "$tmp" -ne 0 ] && echo_i "failed"
status=`expr $status + $tmp`
status=$((status+tmp))
n=`expr $n + 1`
n=$((n+1))
echo_i "test that a zone with too many records is rejected (AXFR) ($n)"
tmp=0
grep "'axfr-too-big/IN'.*: too many records" ns6/named.run >/dev/null || tmp=1
if test $tmp != 0 ; then echo_i "failed"; fi
status=`expr $status + $tmp`
status=$((status+tmp))
n=`expr $n + 1`
n=$((n+1))
echo_i "test that a zone with too many records is rejected (IXFR) ($n)"
tmp=0
grep "'ixfr-too-big./IN.*: too many records" ns6/named.run >/dev/null && tmp=1
@@ -468,18 +478,18 @@ do
done
grep "'ixfr-too-big/IN'.*: too many records" ns6/named.run >/dev/null || tmp=1
if test $tmp != 0 ; then echo_i "failed"; fi
status=`expr $status + $tmp`
status=$((status+tmp))
n=`expr $n + 1`
echo_i "checking whether dig calculates AXFR statistics correctly"
n=$((n+1))
echo_i "checking whether dig calculates AXFR statistics correctly ($n)"
# Loop until the secondary server manages to transfer the "xfer-stats" zone so
# that we can both check dig output and immediately proceed with the next test.
# Use -b so that we can discern between incoming and outgoing transfers in ns3
# logs later on.
tmp=1
for i in 1 2 3 4 5 6 7 8 9 10; do
$DIG $DIGOPTS +noedns +stat -b 10.53.0.2 @10.53.0.3 xfer-stats. AXFR > dig.out.ns3.$n
if grep "; Transfer failed" dig.out.ns3.$n > /dev/null; then
$DIG $DIGOPTS +noedns +stat -b 10.53.0.2 @10.53.0.3 xfer-stats. AXFR > dig.out.ns3.test$n
if grep "; Transfer failed" dig.out.ns3.test$n > /dev/null; then
sleep 1
else
tmp=0
@@ -489,25 +499,25 @@ done
if [ $tmp -ne 0 ]; then
echo_i "timed out waiting for zone transfer"
else
get_dig_xfer_stats dig.out.ns3.$n > stats.dig
get_dig_xfer_stats dig.out.ns3.test$n > stats.dig
diff axfr-stats.good stats.dig || tmp=1
fi
if test $tmp != 0 ; then echo_i "failed"; fi
status=`expr $status + $tmp`
status=$((status+tmp))
# Note: in the next two tests, we use ns3 logs for checking both incoming and
# outgoing transfer statistics as ns3 is both a secondary server (for ns1) and a
# primary server (for dig queries from the previous test) for "xfer-stats".
n=`expr $n + 1`
echo_i "checking whether named calculates incoming AXFR statistics correctly"
n=$((n+1))
echo_i "checking whether named calculates incoming AXFR statistics correctly ($n)"
tmp=0
get_named_xfer_stats ns3/named.run 10.53.0.1 xfer-stats "Transfer completed" > stats.incoming
diff axfr-stats.good stats.incoming || tmp=1
if test $tmp != 0 ; then echo_i "failed"; fi
status=`expr $status + $tmp`
status=$((status+tmp))
n=`expr $n + 1`
echo_i "checking whether named calculates outgoing AXFR statistics correctly"
n=$((n+1))
echo_i "checking whether named calculates outgoing AXFR statistics correctly ($n)"
tmp=1
for i in 0 1 2 3 4 5 6 7 8 9; do
get_named_xfer_stats ns3/named.run 10.53.0.2 xfer-stats "AXFR ended" > stats.outgoing
@@ -518,7 +528,7 @@ for i in 0 1 2 3 4 5 6 7 8 9; do
sleep 1
done
if test $tmp != 0 ; then echo_i "failed"; fi
status=`expr $status + $tmp`
status=$((status+tmp))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
+1
View File
@@ -37,6 +37,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -37,6 +37,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -37,6 +37,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -39,6 +39,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -35,6 +35,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -36,6 +36,7 @@
<year>2016</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -39,6 +39,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1
View File
@@ -35,6 +35,7 @@
<year>2017</year>
<year>2018</year>
<year>2019</year>
<year>2020</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
<!-- insert copyright end -->
+7 -1
View File
@@ -54,10 +54,16 @@ notes.pdf: notes-wrapper.xml ${NOTESXML} releaseinfo.xml pkgversion.xml notevers
${XSLTPROC} ${top_srcdir}/doc/xsl/pre-latex.xsl notes-wrapper.xml | \
${DBLATEX} -c notes.conf -Pdoc.layout="mainmatter" -o notes.pdf -
# Produce notes.txt from notes.html using w3m, with some post-processing:
#
# - remove trailing spaces from every line,
# - remove empty lines from the end of the document,
# - prevent GitLab issue/MR identifiers from being split across two lines.
notes.txt: notes.html
${W3M} -dump -cols 75 -O ascii -T text/html < notes.html | \
sed 's/ *$$//' | \
sed -e :a -e '/^\n*$$/{$$d;N;};/\n$$/ba' > notes.txt
sed -e :a -e '/^\n*$$/{$$d;N;};/\n$$/ba' | \
sed '/ [!#]$$/{N;s| \([!#]\)\(\n\s*\)\([0-9][0-9]*\)|\2\1\3|;};' > notes.txt
# use xmllint to process include
Bv9ARM.html: Bv9ARM-book.xml ${NOTESXML} releaseinfo.xml pkgversion.xml noteversion.xml
+3 -3
View File
@@ -31,7 +31,7 @@
<listitem>
<para>
Added support for multithreaded listening for TCP connections
in the network manager [GL !2659]
in the network manager. [GL !2659]
</para>
</listitem>
</itemizedlist>
@@ -47,8 +47,8 @@
</listitem>
<listitem>
<para>
Fixed several possible race conditions discovered by Thread
Sanitizer.
Fixed several possible race conditions discovered by
ThreadSanitizer.
</para>
</listitem>
</itemizedlist>
+5 -5
View File
@@ -26,18 +26,18 @@
#include <sys/types.h>
#include <isc/platform.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <limits.h>
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
#ifdef WIN32
#include "gen-win32.h"
+104 -70
View File
@@ -15498,21 +15498,93 @@ restore_nsec3param(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *version,
return (result);
}
static isc_result_t
copy_non_dnssec_records(dns_zone_t *zone, dns_db_t *db, dns_db_t *version,
dns_db_t *rawdb, dns_dbiterator_t *dbiterator,
unsigned int *oldserial)
{
dns_dbnode_t *rawnode = NULL, *node = NULL;
dns_fixedname_t fixed;
dns_name_t *name = dns_fixedname_initname(&fixed);
dns_rdataset_t rdataset;
dns_rdatasetiter_t *rdsit = NULL;
isc_result_t result;
result = dns_dbiterator_current(dbiterator, &rawnode, name);
if (result != ISC_R_SUCCESS) {
return (ISC_R_SUCCESS);
}
result = dns_db_findnode(db, name, true, &node);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
result = dns_db_allrdatasets(rawdb, rawnode, NULL, 0, &rdsit);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
dns_rdataset_init(&rdataset);
for (result = dns_rdatasetiter_first(rdsit);
result == ISC_R_SUCCESS;
result = dns_rdatasetiter_next(rdsit))
{
dns_rdatasetiter_current(rdsit, &rdataset);
if (rdataset.type == dns_rdatatype_nsec ||
rdataset.type == dns_rdatatype_rrsig ||
rdataset.type == dns_rdatatype_nsec3 ||
rdataset.type == dns_rdatatype_dnskey ||
rdataset.type == dns_rdatatype_nsec3param) {
/*
* Allow DNSSEC records with dnssec-policy.
* WMM: Perhaps add config option for it.
*/
if (dns_zone_getkasp(zone) == NULL) {
dns_rdataset_disassociate(&rdataset);
continue;
}
}
if (rdataset.type == dns_rdatatype_soa && oldserial != NULL) {
result = checkandaddsoa(db, node, version,
&rdataset, *oldserial);
} else {
result = dns_db_addrdataset(db, node, version,
0, &rdataset, 0,
NULL);
}
dns_rdataset_disassociate(&rdataset);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
}
if (result == ISC_R_NOMORE) {
result = ISC_R_SUCCESS;
}
cleanup:
if (rdsit != NULL) {
dns_rdatasetiter_destroy(&rdsit);
}
if (rawnode) {
dns_db_detachnode(rawdb, &rawnode);
}
if (node) {
dns_db_detachnode(db, &node);
}
return (result);
}
static void
receive_secure_db(isc_task_t *task, isc_event_t *event) {
isc_result_t result;
dns_zone_t *zone;
dns_db_t *rawdb, *db = NULL;
dns_dbnode_t *rawnode = NULL, *node = NULL;
dns_fixedname_t fname;
dns_name_t *name;
dns_dbiterator_t *dbiterator = NULL;
dns_rdatasetiter_t *rdsit = NULL;
dns_rdataset_t rdataset;
dns_dbversion_t *version = NULL;
isc_time_t loadtime;
unsigned int oldserial = 0;
bool have_oldserial = false;
unsigned int oldserial = 0, *oldserialp = NULL;
nsec3paramlist_t nsec3list;
isc_event_t *setnsec3param_event;
dns_zone_t *dummy;
@@ -15525,9 +15597,6 @@ receive_secure_db(isc_task_t *task, isc_event_t *event) {
rawdb = ((struct secure_event *)event)->db;
isc_event_free(&event);
name = dns_fixedname_initname(&fname);
dns_rdataset_init(&rdataset);
LOCK_ZONE(zone);
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING) || !inline_secure(zone)) {
result = ISC_R_SHUTTINGDOWN;
@@ -15538,8 +15607,9 @@ receive_secure_db(isc_task_t *task, isc_event_t *event) {
ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL) {
result = dns_db_getsoaserial(zone->db, NULL, &oldserial);
if (result == ISC_R_SUCCESS)
have_oldserial = true;
if (result == ISC_R_SUCCESS) {
oldserialp = &oldserial;
}
/*
* assemble nsec3parameters from the old zone, and set a flag
@@ -15556,8 +15626,9 @@ receive_secure_db(isc_task_t *task, isc_event_t *event) {
result = dns_db_create(zone->mctx, zone->db_argv[0],
&zone->origin, dns_dbtype_zone, zone->rdclass,
zone->db_argc - 1, zone->db_argv + 1, &db);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
goto failure;
}
result = dns_db_setgluecachestats(db, zone->gluecachestats);
if (result != ISC_R_SUCCESS && result != ISC_R_NOTIMPLEMENTED) {
@@ -15565,62 +15636,28 @@ receive_secure_db(isc_task_t *task, isc_event_t *event) {
}
result = dns_db_newversion(db, &version);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
goto failure;
}
result = dns_db_createiterator(rawdb, 0, &dbiterator);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
goto failure;
}
for (result = dns_dbiterator_first(dbiterator);
result == ISC_R_SUCCESS;
result = dns_dbiterator_next(dbiterator)) {
result = dns_dbiterator_current(dbiterator, &rawnode, name);
if (result != ISC_R_SUCCESS)
continue;
result = dns_db_findnode(db, name, true, &node);
if (result != ISC_R_SUCCESS)
result = dns_dbiterator_next(dbiterator))
{
result = copy_non_dnssec_records(zone, db, version, rawdb,
dbiterator, oldserialp);
if (result != ISC_R_SUCCESS) {
goto failure;
result = dns_db_allrdatasets(rawdb, rawnode, NULL, 0, &rdsit);
if (result != ISC_R_SUCCESS)
goto failure;
for (result = dns_rdatasetiter_first(rdsit);
result == ISC_R_SUCCESS;
result = dns_rdatasetiter_next(rdsit)) {
dns_rdatasetiter_current(rdsit, &rdataset);
if (rdataset.type == dns_rdatatype_nsec ||
rdataset.type == dns_rdatatype_rrsig ||
rdataset.type == dns_rdatatype_nsec3 ||
rdataset.type == dns_rdatatype_dnskey ||
rdataset.type == dns_rdatatype_nsec3param) {
/*
* Allow DNSSEC records with dnssec-policy.
* WMM: Perhaps add config option for it.
*/
if (dns_zone_getkasp(zone) == NULL) {
dns_rdataset_disassociate(&rdataset);
continue;
}
}
if (rdataset.type == dns_rdatatype_soa &&
have_oldserial) {
result = checkandaddsoa(db, node, version,
&rdataset, oldserial);
} else
result = dns_db_addrdataset(db, node, version,
0, &rdataset, 0,
NULL);
if (result != ISC_R_SUCCESS)
goto failure;
dns_rdataset_disassociate(&rdataset);
}
dns_rdatasetiter_destroy(&rdsit);
dns_db_detachnode(rawdb, &rawnode);
dns_db_detachnode(db, &node);
}
dns_dbiterator_destroy(&dbiterator);
if (result != ISC_R_NOMORE) {
goto failure;
}
/*
@@ -15660,9 +15697,13 @@ receive_secure_db(isc_task_t *task, isc_event_t *event) {
failure:
UNLOCK_ZONE(zone);
if (result != ISC_R_SUCCESS)
if (dbiterator != NULL) {
dns_dbiterator_destroy(&dbiterator);
}
if (result != ISC_R_SUCCESS) {
dns_zone_log(zone, ISC_LOG_ERROR, "receive_secure_db: %s",
dns_result_totext(result));
}
while (!ISC_LIST_EMPTY(nsec3list)) {
nsec3param_t *nsec3p;
@@ -15670,20 +15711,13 @@ receive_secure_db(isc_task_t *task, isc_event_t *event) {
ISC_LIST_UNLINK(nsec3list, nsec3p, link);
isc_mem_put(zone->mctx, nsec3p, sizeof(nsec3param_t));
}
if (dns_rdataset_isassociated(&rdataset))
dns_rdataset_disassociate(&rdataset);
if (db != NULL) {
if (node != NULL)
dns_db_detachnode(db, &node);
if (version != NULL)
if (version != NULL) {
dns_db_closeversion(db, &version, false);
}
dns_db_detach(&db);
}
if (rawnode != NULL)
dns_db_detachnode(rawdb, &rawnode);
dns_db_detach(&rawdb);
if (dbiterator != NULL)
dns_dbiterator_destroy(&dbiterator);
dns_zone_idetach(&zone);
INSIST(version == NULL);
+34 -26
View File
@@ -107,13 +107,14 @@ struct isc__task {
isc_eventlist_t on_shutdown;
unsigned int nevents;
unsigned int quantum;
unsigned int flags;
isc_stdtime_t now;
isc_time_t tnow;
char name[16];
void * tag;
unsigned int threadid;
bool bound;
/* Protected by atomics */
atomic_uint_fast32_t flags;
/* Locked by task manager lock. */
LINK(isc__task_t) link;
LINK(isc__task_t) ready_link;
@@ -123,8 +124,15 @@ struct isc__task {
#define TASK_F_SHUTTINGDOWN 0x01
#define TASK_F_PRIVILEGED 0x02
#define TASK_SHUTTINGDOWN(t) (((t)->flags & TASK_F_SHUTTINGDOWN) \
!= 0)
#define TASK_SHUTTINGDOWN(t) \
((atomic_load_acquire(&(t)->flags) & TASK_F_SHUTTINGDOWN) != 0)
#define TASK_PRIVILEGED(t) \
((atomic_load_acquire(&(t)->flags) & TASK_F_PRIVILEGED) != 0)
#define TASK_FLAG_SET(t, f) \
atomic_fetch_or_release(&(t)->flags, (f))
#define TASK_FLAG_CLR(t, f) \
atomic_fetch_and_release(&(t)->flags, ~(f))
#define TASK_MANAGER_MAGIC ISC_MAGIC('T', 'S', 'K', 'M')
#define VALID_MANAGER(m) ISC_MAGIC_VALID(m, TASK_MANAGER_MAGIC)
@@ -301,7 +309,7 @@ isc_task_create_bound(isc_taskmgr_t *manager0, unsigned int quantum,
INIT_LIST(task->on_shutdown);
task->nevents = 0;
task->quantum = (quantum > 0) ? quantum : manager->default_quantum;
task->flags = 0;
atomic_init(&task->flags, 0);
task->now = 0;
isc_time_settoepoch(&task->tnow);
memset(task->name, 0, sizeof(task->name));
@@ -364,7 +372,7 @@ task_shutdown(isc__task_t *task) {
if (! TASK_SHUTTINGDOWN(task)) {
XTRACE("shutting down");
task->flags |= TASK_F_SHUTTINGDOWN;
TASK_FLAG_SET(task, TASK_F_SHUTTINGDOWN);
if (task->state == task_state_idle) {
INSIST(EMPTY(task->events));
task->state = task_state_ready;
@@ -790,13 +798,14 @@ isc_task_onshutdown(isc_task_t *task0, isc_taskaction_t action,
arg,
sizeof(*event));
LOCK(&task->lock);
if (TASK_SHUTTINGDOWN(task)) {
disallowed = true;
result = ISC_R_SHUTTINGDOWN;
} else
} else {
LOCK(&task->lock);
ENQUEUE(task->on_shutdown, event, ev_link);
UNLOCK(&task->lock);
UNLOCK(&task->lock);
}
if (disallowed)
isc_mem_put(task->manager->mctx, event, sizeof(*event));
@@ -956,7 +965,7 @@ pop_readyq(isc__taskmgr_t *manager, int c) {
static inline void
push_readyq(isc__taskmgr_t *manager, isc__task_t *task, int c) {
ENQUEUE(manager->queues[c].ready_tasks, task, ready_link);
if ((task->flags & TASK_F_PRIVILEGED) != 0) {
if (TASK_PRIVILEGED(task)) {
ENQUEUE(manager->queues[c].ready_priority_tasks, task,
ready_priority_link);
}
@@ -1715,18 +1724,21 @@ isc_task_setprivilege(isc_task_t *task0, bool priv) {
REQUIRE(ISCAPI_TASK_VALID(task0));
isc__task_t *task = (isc__task_t *)task0;
isc__taskmgr_t *manager = task->manager;
bool oldpriv;
uint_fast32_t oldflags, newflags;
LOCK(&task->lock);
oldpriv = ((task->flags & TASK_F_PRIVILEGED) != 0);
if (priv)
task->flags |= TASK_F_PRIVILEGED;
else
task->flags &= ~TASK_F_PRIVILEGED;
UNLOCK(&task->lock);
if (priv == oldpriv)
return;
oldflags = atomic_load_acquire(&task->flags);
do {
if (priv) {
newflags = oldflags | TASK_F_PRIVILEGED;
} else {
newflags = oldflags & ~TASK_F_PRIVILEGED;
}
if (newflags == oldflags) {
return;
}
} while (!atomic_compare_exchange_weak_acq_rel(&task->flags,
&oldflags,
newflags));
LOCK(&manager->queues[task->threadid].lock);
if (priv && ISC_LINK_LINKED(task, ready_link))
@@ -1741,20 +1753,16 @@ isc_task_setprivilege(isc_task_t *task0, bool priv) {
bool
isc_task_privilege(isc_task_t *task0) {
isc__task_t *task = (isc__task_t *)task0;
bool priv;
REQUIRE(VALID_TASK(task));
LOCK(&task->lock);
priv = ((task->flags & TASK_F_PRIVILEGED) != 0);
UNLOCK(&task->lock);
return (priv);
return (TASK_PRIVILEGED(task));
}
bool
isc_task_exiting(isc_task_t *t) {
isc__task_t *task = (isc__task_t *)t;
REQUIRE(VALID_TASK(task));
return (TASK_SHUTTINGDOWN(task));
}
Executable
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
# `kyua debug` command does not work with libtool (see
# https://github.com/jmmv/kyua/issues/207). On some distributions `kyua debug`
# runs the first `gdb` it finds in $PATH, but on Debian and Ubuntu it looks for
# `/usr/bin/gdb`. This script expects `gdb` to be moved to `gdb.orig` and
# executed from there.
coredump="$6"
binary=$(gdb.orig --batch --core="${coredump}" 2>/dev/null | sed -ne "s/Core was generated by \`\(.*\)'./\1/p")
# GDB 6.3 from OpenBSD 6.6 does not tell the full path of the broken binary.
# We need to fix it. Either the binary or it's libtool script will do.
if [ ! -e "${binary}" ]; then
binary="$(find "${TOP}" -name "${binary}" | head -n 1)"
fi
# $TOP points to BIND sources and should be set on `kyua debug` invocation.
"${TOP}/libtool" --mode=execute gdb.orig \
--batch \
--command="${TOP}/bin/tests/system/run.gdb" \
--core="${coredump}" \
-- \
"${binary}"
+47 -3
View File
@@ -1,8 +1,16 @@
#!/bin/sh
# Find the top of the BIND9 tree.
export TOP=@abs_top_builddir@
KYUA=@KYUA@
UNITTESTS=@UNITTESTS@
CMOCKA_MESSAGE_OUTPUT=TAP
export CMOCKA_MESSAGE_OUTPUT
GDB="$(command -v gdb)"
kyua_report() {
${KYUA} --logfile /dev/null report --verbose --results-file "${KYUA_RESULT:-LATEST}"
}
status=0
if [ -n "${UNITTESTS}" ] && [ -f Kyuafile ]
@@ -13,14 +21,50 @@ then
${KYUA} -v parallelism="${TEST_PARALLEL_JOBS:-1}" --logfile kyua.log --loglevel debug test --results-file "${KYUA_RESULT:-NEW}"
status=$?
${KYUA} --logfile /dev/null report --results-file "${KYUA_RESULT:-LATEST}"
kyua_report
if [ "${status}" -eq "0" ]
if command -v sysctl >/dev/null; then
if [ "$(uname -s)" = "Linux" ] && [ "$(sysctl -n kernel.core_uses_pid)" -ne 1 ]; then
echo "kernel.core_uses_pid is not set on the Linux host"
echo "kyua may not find core file of broken tests"
fi
else
echo "sysctl command is not present, can't check kernel.core_uses_pid."
echo "kyua may not find core file of broken tests"
fi
# Use kyua-debug(1) facility to gather additional data on failed tests.
# Some runs will just show verbose information from the run, some will
# show backtrace via gdb(1).
broken_tests=$(kyua_report | awk '$2 == "->" && $0 !~ "skipped" { print $1 }')
if [ -n "${CI}" ] && [ "$(id -u)" -eq 0 ] && [ -n "${broken_tests}" ] && [ -n "${GDB}" ]; then
if grep '^#define USE_LIBTOOL 1$' "${TOP}/config.h" >/dev/null; then
# kyua debug command misidentifies broken binary when libtool is used
# to configure BIND (see https://github.com/jmmv/kyua/issues/207).
# Here we try "trick" kyua use our custom gdb script instead
# of using gdb(1) directly. That's why this part needs to be run as root
# and, for safety reasons, only in the CI.
mv "${GDB}" "${GDB}.orig"
cp "${TOP}/unit/gdb" "${GDB}"
for test in ${broken_tests}; do
echo
${KYUA} debug "${test}"
done
mv "${GDB}.orig" "${GDB}"
else
for test in ${broken_tests}; do
echo
${KYUA} debug "${test}"
done
fi
fi
if [ "${status}" -eq 0 ]
then
rm -f kyua.log
echo "R:PASS"
else
echo "R:FAIL"
echo "R:FAIL:status:${status}"
fi
echo "E:unit:$(date)"
fi
+2439 -2438
View File
File diff suppressed because it is too large Load Diff