Merge branch 'michal/backport-missing-legacy-system-test-checks' into 'v9_11'

Backport missing "legacy" system test checks

See merge request isc-projects/bind9!1986
This commit is contained in:
Michał Kępień
2019-05-31 06:56:12 -04:00
17 changed files with 256 additions and 26 deletions

View File

@@ -2696,6 +2696,31 @@ client_request(isc_task_t *task, isc_event_t *event) {
client->ecs_scope = 0;
if (opt != NULL) {
/*
* Are returning FORMERR to all EDNS queries?
* Simulate a STD13 compliant server.
*/
if (ns_g_ednsformerr) {
ns_client_error(client, DNS_R_FORMERR);
return;
}
/*
* Are returning NOTIMP to all EDNS queries?
*/
if (ns_g_ednsnotimp) {
ns_client_error(client, DNS_R_NOTIMP);
return;
}
/*
* Are returning REFUSED to all EDNS queries?
*/
if (ns_g_ednsrefused) {
ns_client_error(client, DNS_R_REFUSED);
return;
}
/*
* Are we dropping all EDNS queries?
*/
@@ -2703,6 +2728,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
ns_client_next(client, ISC_R_SUCCESS);
goto cleanup;
}
result = process_opt(client, opt);
if (result != ISC_R_SUCCESS)
goto cleanup;

View File

@@ -77,7 +77,7 @@ EXTERN in_port_t lwresd_g_listenport INIT(0);
EXTERN ns_server_t * ns_g_server INIT(NULL);
EXTERN bool ns_g_lwresdonly INIT(false);
EXTERN bool ns_g_lwresdonly INIT(false);
/*
* Logging.
@@ -105,9 +105,9 @@ EXTERN const char * lwresd_g_conffile INIT(NS_SYSCONFDIR
"/lwresd.conf");
EXTERN const char * lwresd_g_resolvconffile INIT("/etc"
"/resolv.conf");
EXTERN bool ns_g_conffileset INIT(false);
EXTERN bool lwresd_g_useresolvconf INIT(false);
EXTERN uint16_t ns_g_udpsize INIT(4096);
EXTERN bool ns_g_conffileset INIT(false);
EXTERN bool lwresd_g_useresolvconf INIT(false);
EXTERN uint16_t ns_g_udpsize INIT(4096);
EXTERN cfg_aclconfctx_t * ns_g_aclconfctx INIT(NULL);
/*
@@ -121,11 +121,11 @@ EXTERN isc_resourcevalue_t ns_g_initopenfiles INIT(0);
/*
* Misc.
*/
EXTERN bool ns_g_coreok INIT(true);
EXTERN bool ns_g_coreok INIT(true);
EXTERN const char * ns_g_chrootdir INIT(NULL);
EXTERN bool ns_g_foreground INIT(false);
EXTERN bool ns_g_logstderr INIT(false);
EXTERN bool ns_g_nosyslog INIT(false);
EXTERN bool ns_g_foreground INIT(false);
EXTERN bool ns_g_logstderr INIT(false);
EXTERN bool ns_g_nosyslog INIT(false);
EXTERN const char * ns_g_logfile INIT(NULL);
EXTERN const char * ns_g_defaultsessionkeyfile
@@ -134,7 +134,7 @@ EXTERN const char * ns_g_defaultsessionkeyfile
EXTERN const char * ns_g_defaultlockfile INIT(NS_LOCALSTATEDIR
"/run/named/"
"named.lock");
EXTERN bool ns_g_forcelock INIT(false);
EXTERN bool ns_g_forcelock INIT(false);
#if NS_RUN_PID_DIR
EXTERN const char * ns_g_defaultpidfile INIT(NS_LOCALSTATEDIR
@@ -169,21 +169,24 @@ EXTERN const char * ns_g_engine INIT(NULL);
EXTERN int ns_g_listen INIT(3);
EXTERN isc_time_t ns_g_boottime;
EXTERN isc_time_t ns_g_configtime;
EXTERN bool ns_g_memstatistics INIT(false);
EXTERN bool ns_g_clienttest INIT(false);
EXTERN bool ns_g_dropedns INIT(false);
EXTERN bool ns_g_noedns INIT(false);
EXTERN bool ns_g_nosoa INIT(false);
EXTERN bool ns_g_noaa INIT(false);
EXTERN bool ns_g_keepstderr INIT(false);
EXTERN bool ns_g_memstatistics INIT(false);
EXTERN bool ns_g_clienttest INIT(false);
EXTERN bool ns_g_dropedns INIT(false);
EXTERN bool ns_g_ednsformerr INIT(false);
EXTERN bool ns_g_ednsnotimp INIT(false);
EXTERN bool ns_g_ednsrefused INIT(false);
EXTERN bool ns_g_noedns INIT(false);
EXTERN bool ns_g_nosoa INIT(false);
EXTERN bool ns_g_noaa INIT(false);
EXTERN bool ns_g_keepstderr INIT(false);
EXTERN unsigned int ns_g_delay INIT(0);
EXTERN bool ns_g_nonearest INIT(false);
EXTERN bool ns_g_notcp INIT(false);
EXTERN bool ns_g_disable6 INIT(false);
EXTERN bool ns_g_disable4 INIT(false);
EXTERN bool ns_g_nonearest INIT(false);
EXTERN bool ns_g_notcp INIT(false);
EXTERN bool ns_g_disable6 INIT(false);
EXTERN bool ns_g_disable4 INIT(false);
EXTERN unsigned int ns_g_tat_interval INIT(24*3600);
EXTERN bool ns_g_fixedlocal INIT(false);
EXTERN bool ns_g_sigvalinsecs INIT(false);
EXTERN bool ns_g_fixedlocal INIT(false);
EXTERN bool ns_g_sigvalinsecs INIT(false);
#ifdef HAVE_GEOIP
EXTERN dns_geoip_databases_t *ns_g_geoip INIT(NULL);

View File

@@ -479,6 +479,12 @@ parse_T_opt(char *option) {
ns_g_dropedns = true;
} else if (!strncmp(option, "dscp=", 5)) {
isc_dscp_check_value = atoi(option + 5);
} else if (!strcmp(option, "ednsformerr")) {
ns_g_ednsformerr = true;
} else if (!strcmp(option, "ednsnotimp")) {
ns_g_ednsnotimp = true;
} else if (!strcmp(option, "ednsrefused")) {
ns_g_ednsrefused = true;
} else if (!strcmp(option, "fixedlocal")) {
ns_g_fixedlocal = true;
} else if (!strcmp(option, "keepstderr")) {
@@ -538,7 +544,7 @@ parse_T_opt(char *option) {
} else if (!strncmp(option, "tat=", 4)) {
ns_g_tat_interval = atoi(option + 4);
} else {
fprintf(stderr, "unknown -T flag '%s\n", option);
fprintf(stderr, "unknown -T flag '%s'\n", option);
}
}

View File

@@ -8,9 +8,9 @@
# information regarding copyright ownership.
rm -f dig.out.*
rm -f ns?/named.conf
rm -f ns?/named.memstats
rm -f ns?/named.run
rm -f ns*/named.conf
rm -f ns*/named.memstats
rm -f ns*/named.run
rm -f ns*/named.lock
# build.sh

View File

@@ -23,3 +23,9 @@ edns512. NS ns.edns512.
ns.edns512. A 10.53.0.6
edns512-notcp. NS ns.edns512-notcp.
ns.edns512-notcp. A 10.53.0.7
ednsformerr. NS ns.ednsformerr.
ns.ednsformerr. A 10.53.0.8
ednsnotimp. NS ns.ednsnotimp.
ns.ednsnotimp. A 10.53.0.9
ednsrefused. NS ns.ednsrefused.
ns.ednsrefused. A 10.53.0.10

View File

@@ -0,0 +1,12 @@
; 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.
@ 60 SOA ns marka.isc.org. 1 0 0 0 0
@ 60 NS ns
ns 60 A 10.53.0.8

View File

@@ -0,0 +1,27 @@
/*
* 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.
*/
options {
query-source address 10.53.0.10;
notify-source 10.53.0.10;
transfer-source 10.53.0.10;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.10; };
listen-on-v6 { none; };
recursion no;
dnssec-validation no;
};
zone "ednsrefused" {
type master;
file "ednsrefused.db";
};

View File

@@ -0,0 +1 @@
ednsrefused

View File

@@ -0,0 +1,12 @@
; 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.
@ 60 SOA ns marka.isc.org. 1 0 0 0 0
@ 60 NS ns
ns 60 A 10.53.0.8

View File

@@ -0,0 +1,27 @@
/*
* 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.
*/
options {
query-source address 10.53.0.8;
notify-source 10.53.0.8;
transfer-source 10.53.0.8;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.8; };
listen-on-v6 { none; };
recursion no;
dnssec-validation no;
};
zone "ednsformerr" {
type master;
file "ednsformerr.db";
};

View File

@@ -0,0 +1 @@
ednsformerr

View File

@@ -0,0 +1,12 @@
; 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.
@ 60 SOA ns marka.isc.org. 1 0 0 0 0
@ 60 NS ns
ns 60 A 10.53.0.8

View File

@@ -0,0 +1,27 @@
/*
* 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.
*/
options {
query-source address 10.53.0.9;
notify-source 10.53.0.9;
transfer-source 10.53.0.9;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.9; };
listen-on-v6 { none; };
recursion no;
dnssec-validation no;
};
zone "ednsnotimp" {
type master;
file "ednsnotimp.db";
};

View File

@@ -0,0 +1 @@
ednsnotimp

View File

@@ -22,3 +22,6 @@ copy_setports ns4/named.conf.in ns4/named.conf
copy_setports ns5/named.conf.in ns5/named.conf
copy_setports ns6/named.conf.in ns6/named.conf
copy_setports ns7/named.conf.in ns7/named.conf
copy_setports ns8/named.conf.in ns8/named.conf
copy_setports ns9/named.conf.in ns9/named.conf
copy_setports ns10/named.conf.in ns10/named.conf

View File

@@ -44,6 +44,63 @@ resolution_fails() {
status=0
n=0
n=`expr $n + 1`
echo_i "checking formerr edns server setup ($n)"
ret=0
$DIG $DIGOPTS +edns @10.53.0.8 ednsformerr soa > dig.out.1.test$n || ret=1
grep "status: FORMERR" dig.out.1.test$n > /dev/null || ret=1
grep "EDNS: version:" dig.out.1.test$n > /dev/null && ret=1
$DIG $DIGOPTS +noedns @10.53.0.8 ednsformerr soa > dig.out.2.test$n || ret=1
grep "status: NOERROR" dig.out.2.test$n > /dev/null || ret=1
grep "EDNS: version:" dig.out.2.test$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking recursive lookup to formerr edns server succeeds ($n)"
ret=0
resolution_succeeds ednsformerr. || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking notimp edns server setup ($n)"
ret=0
$DIG $DIGOPTS +edns @10.53.0.9 ednsnotimp soa > dig.out.1.test$n || ret=1
grep "status: NOTIMP" dig.out.1.test$n > /dev/null || ret=1
grep "EDNS: version:" dig.out.1.test$n > /dev/null && ret=1
$DIG $DIGOPTS +noedns @10.53.0.9 ednsnotimp soa > dig.out.2.test$n || ret=1
grep "status: NOERROR" dig.out.2.test$n > /dev/null || ret=1
grep "EDNS: version:" dig.out.2.test$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking recursive lookup to notimp edns server succeeds ($n)"
ret=0
resolution_succeeds ednsnotimp. || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking refused edns server setup ($n)"
ret=0
$DIG $DIGOPTS +edns @10.53.0.10 ednsrefused soa > dig.out.1.test$n || ret=1
grep "status: REFUSED" dig.out.1.test$n > /dev/null || ret=1
grep "EDNS: version:" dig.out.1.test$n > /dev/null && ret=1
$DIG $DIGOPTS +noedns @10.53.0.10 ednsrefused soa > dig.out.2.test$n || ret=1
grep "status: NOERROR" dig.out.2.test$n > /dev/null || ret=1
grep "EDNS: version:" dig.out.2.test$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking recursive lookup to refused edns server fails ($n)"
ret=0
resolution_fails ednsrefused. || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking drop edns server setup ($n)"
ret=0

View File

@@ -1592,6 +1592,9 @@
./bin/tests/system/legacy/ns1/named2.conf.in CONF-C 2018,2019
./bin/tests/system/legacy/ns1/root.db ZONE 2014,2016,2018,2019
./bin/tests/system/legacy/ns1/trusted.conf X 2014,2018,2019
./bin/tests/system/legacy/ns10/ednsrefused.db ZONE 2018,2019
./bin/tests/system/legacy/ns10/named.conf.in CONF-C 2018,2019
./bin/tests/system/legacy/ns10/named.ednsrefused X 2018,2019
./bin/tests/system/legacy/ns2/dropedns.db ZONE 2014,2016,2018,2019
./bin/tests/system/legacy/ns2/named.conf.in CONF-C 2018,2019
./bin/tests/system/legacy/ns2/named.dropedns X 2014,2018,2019
@@ -1617,6 +1620,12 @@
./bin/tests/system/legacy/ns7/named.conf.in CONF-C 2018,2019
./bin/tests/system/legacy/ns7/named.notcp X 2014,2018,2019
./bin/tests/system/legacy/ns7/sign.sh SH 2014,2016,2018,2019
./bin/tests/system/legacy/ns8/ednsformerr.db ZONE 2018,2019
./bin/tests/system/legacy/ns8/named.conf.in CONF-C 2018,2019
./bin/tests/system/legacy/ns8/named.ednsformerr X 2018,2019
./bin/tests/system/legacy/ns9/ednsnotimp.db ZONE 2018,2019
./bin/tests/system/legacy/ns9/named.conf.in CONF-C 2018,2019
./bin/tests/system/legacy/ns9/named.ednsnotimp X 2018,2019
./bin/tests/system/legacy/setup.sh SH 2014,2016,2018,2019
./bin/tests/system/legacy/tests.sh SH 2014,2015,2016,2018,2019
./bin/tests/system/limits/clean.sh SH 2000,2001,2004,2007,2012,2014,2015,2016,2018,2019