From be879cda728b9fac3208f39148869d46c9c919e7 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 8 Nov 2021 14:05:42 +1100 Subject: [PATCH 1/2] Replace incorrect sed expersion with awk The sed expression could find the wrong instance of 10. Use awk to replace the TTL field and also to specify the server and issue the send command. --- bin/tests/system/nsupdate/clean.sh | 1 + bin/tests/system/nsupdate/tests.sh | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/tests/system/nsupdate/clean.sh b/bin/tests/system/nsupdate/clean.sh index aa327f8962..ac3f12f197 100644 --- a/bin/tests/system/nsupdate/clean.sh +++ b/bin/tests/system/nsupdate/clean.sh @@ -63,4 +63,5 @@ rm -f perl.update_test.out rm -f nsupdate.out* rm -f typelist.out.* rm -f update.out.* +rm -f update.in.* rm -f verylarge diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh index 88910f95a3..7b9c0e6177 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh @@ -750,9 +750,10 @@ ret=0 echo_i "check that changes to the DNSKEY RRset TTL do not have side effects ($n)" $DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd dnskey.test. \ @10.53.0.3 dnskey | \ - sed -n 's/\(.*\)10.IN/update add \1600 IN/p' | - (echo server 10.53.0.3 ${PORT}; cat - ; echo send ) | -$NSUPDATE + awk -v port="${PORT}" 'BEGIN { print "server 10.53.0.3", port; } + $2 == 10 && $3 == "IN" && $4 == "DNSKEY" { $2 = 600; print "update add", $0 } + END { print "send" }' > update.in.$n +$NSUPDATE update.in.$n $DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd dnskey.test. \ @10.53.0.3 any > dig.out.ns3.$n From c1df7884f028d9f1434ba1b971e3e83a5868ff12 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 8 Nov 2021 14:10:19 +1100 Subject: [PATCH 2/2] Add CHANGES note for [GL #3003] --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 28305b4ddf..c9a8b7b32a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5757. [test] Replace sed in nsupdate system test with awk to + construct the nsupdate command. The sed expression + was not reliably changing the ttl. [GL #3003] + 5756. [func] Assign HTTP freshness lifetime to responses sent via DNS-over-HTTPS, according to the recommendations given in RFC 8484. [GL #2854]