-
-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1198 from NLnetLabs/bugfix/log-servfail-serve-exp…
…ired Fix log-servfail with serve expired and no useful cache contents
- Loading branch information
Showing
17 changed files
with
127 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ server: | |
minimal-responses: no | ||
rrset-roundrobin: no | ||
ede: yes | ||
log-servfail: yes | ||
|
||
stub-zone: | ||
name: "." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
server: | ||
verbosity: 0 | ||
use-syslog: no | ||
directory: "" | ||
pidfile: "unbound.pid" | ||
chroot: "" | ||
username: "" | ||
do-not-query-localhost: no | ||
use-caps-for-id: no | ||
port: @SERVER_PORT@ | ||
interface: 127.0.0.1 | ||
outbound-msg-retry: 0 | ||
|
||
log-servfail: yes | ||
|
||
forward-zone: | ||
name: "a.servfail" | ||
forward-addr: 127.0.0.1@@SERVER_PORT@ | ||
|
||
forward-zone: | ||
name: "b.servfail" | ||
forward-addr: 127.0.0.1@@SERVER_PORT@ | ||
|
||
remote-control: | ||
control-enable: yes | ||
control-port: @CONTROL_PORT@ | ||
control-use-cert: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
BaseName: log_servfail | ||
Version: 1.0 | ||
Description: Check the log_servfail option | ||
CreationDate: Fri 29 Nov 11:00:00 CEST 2024 | ||
Maintainer: | ||
Category: | ||
Component: | ||
CmdDepends: | ||
Depends: | ||
Help: | ||
Pre: log_servfail.pre | ||
Post: log_servfail.post | ||
Test: log_servfail.test | ||
AuxFiles: | ||
Passed: | ||
Failure: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# #-- log_servfail.post --# | ||
# source the master var file when it's there | ||
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master | ||
# source the test var file when it's there | ||
[ -f .tpkg.var.test ] && source .tpkg.var.test | ||
# | ||
# do your teardown here | ||
. ../common.sh | ||
kill_from_pidfile "unbound.pid" | ||
cat unbound.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# #-- log_servfail.pre--# | ||
PRE="../.." | ||
. ../common.sh | ||
|
||
get_random_port 2 | ||
SERVER_PORT=$RND_PORT | ||
CONTROL_PORT=$(($RND_PORT + 1)) | ||
echo "SERVER_PORT=$SERVER_PORT" >> .tpkg.var.test | ||
echo "CONTROL_PORT=$CONTROL_PORT" >> .tpkg.var.test | ||
|
||
# make config file | ||
sed \ | ||
-e 's/@SERVER_PORT\@/'$SERVER_PORT'/' \ | ||
-e 's/@CONTROL_PORT\@/'$CONTROL_PORT'/' \ | ||
< log_servfail.conf > ub.conf | ||
|
||
# start unbound in the background | ||
$PRE/unbound -d -c ub.conf > unbound.log 2>&1 & | ||
|
||
cat .tpkg.var.test | ||
wait_unbound_up unbound.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# #-- cookie_file.test --# | ||
# source the master var file when it's there | ||
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master | ||
# use .tpkg.var.test for in test variable passing | ||
[ -f .tpkg.var.test ] && source .tpkg.var.test | ||
PRE="../.." | ||
. ../common.sh | ||
|
||
outfile=dig.out | ||
|
||
teststep "Check if log-servfail logs to output for iterator error" | ||
dig a.servfail @127.0.0.1 -p $SERVER_PORT > $outfile | ||
if ! grep "SERVFAIL" $outfile | ||
then | ||
cat $outfile | ||
echo "Did not get a SERVFAIL response" | ||
exit 1 | ||
fi | ||
if ! grep "SERVFAIL <a\.servfail\. " unbound.log | ||
then | ||
echo "No log-servfail in output" | ||
exit 1 | ||
fi | ||
|
||
teststep "Enable serve expired" | ||
$PRE/unbound-control -c ub.conf set_option serve-expired: yes | ||
if test $? -ne 0 | ||
then | ||
echo "unbound-control command exited with non-zero error code" | ||
exit 1 | ||
fi | ||
|
||
teststep "Check if log-servfail logs to output for iterator error (with serve-expired)" | ||
dig b.servfail @127.0.0.1 -p $SERVER_PORT > $outfile | ||
if ! grep "SERVFAIL" $outfile | ||
then | ||
cat $outfile | ||
echo "Did not get a SERVFAIL response" | ||
exit 1 | ||
fi | ||
if ! grep "SERVFAIL <b\.servfail\. " unbound.log | ||
then | ||
echo "No log-servfail in output" | ||
exit 1 | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ server: | |
minimal-responses: no | ||
rrset-roundrobin: no | ||
ede: yes | ||
log-servfail: yes | ||
|
||
stub-zone: | ||
name: "." | ||
|