From a7704ad49f3ff7593f25d7ed28475b72a8b2c6f9 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 2 Apr 2025 15:52:20 +0200 Subject: [PATCH] - Fix unbound-control test so it counts the new flush_negative output, also answers the _ta probe from testns and prints command output and skip a thread specific test when no threads are available. --- doc/Changelog | 5 +++++ .../09-unbound-control.test | 16 +++++++++++++--- .../09-unbound-control.testns | 8 ++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 321a3b9b7..fff1cc51d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -3,6 +3,11 @@ 'gcc-15 -Wbuiltin-declaration-mismatch' error in compat/malloc.c. - For #1262, ifdef is no longer needed. +2 April 2025: Wouter + - Fix unbound-control test so it counts the new flush_negative output, + also answers the _ta probe from testns and prints command output + and skip a thread specific test when no threads are available. + 1 April 2025: Wouter - Fix escape more characters when printing an RR type with an unquoted string. diff --git a/testdata/09-unbound-control.tdir/09-unbound-control.test b/testdata/09-unbound-control.tdir/09-unbound-control.test index 80f64c978..da284c2c0 100644 --- a/testdata/09-unbound-control.tdir/09-unbound-control.test +++ b/testdata/09-unbound-control.tdir/09-unbound-control.test @@ -68,9 +68,12 @@ fail_answer () { # Issue an unbound-control command # $@: command arguments -control_command () { +control_command() { echo "$PRE/unbound-control $@" $PRE/unbound-control $@ > outfile + exitstatus=$? + cat outfile + return $exitstatus } # Reload the server and check the reload has finished processing @@ -249,6 +252,10 @@ expect_exit_value 1 teststep "clean reload" clean_reload +# The flush negative only works if the server is either on 1 thread, +# or there is threading enabled. Multiple processes does not work for the +# test, since the printout does not have the stats of a global cache. +if test $num_threads -le 1 -o "$have_threads" = "yes"; then teststep "Check negative flushing" query always.empty. expect_answer "SERVFAIL" @@ -256,10 +263,13 @@ query always.empty. DNSKEY expect_answer "SERVFAIL" control_command -c ub.conf flush_negative expect_exit_value 0 -expect_answer "^ok removed .*, 2 messages and 1 key" +expect_answer "^ok removed .*, 3 messages and 1 key entries" control_command -c ub.conf flush_negative expect_exit_value 0 -expect_answer "^ok removed .*, 0 messages and 0 key" +expect_answer "^ok removed .*, 0 messages and 0 key entries" +else + echo "> skip Check negative flushing, because no threads" +fi teststep "create a new local zone" control_command -c ub.conf local_zone example.net static diff --git a/testdata/09-unbound-control.tdir/09-unbound-control.testns b/testdata/09-unbound-control.tdir/09-unbound-control.testns index 44466b4da..311af0f7e 100644 --- a/testdata/09-unbound-control.tdir/09-unbound-control.testns +++ b/testdata/09-unbound-control.tdir/09-unbound-control.testns @@ -34,3 +34,11 @@ ADJUST copy_id SECTION QUESTION always.empty. IN DNSKEY ENTRY_END + +ENTRY_BEGIN +MATCH opcode qtype qname +REPLY QR AA NOERROR +ADJUST copy_id +SECTION QUESTION +_ta-c5aa.always.empty. IN NULL +ENTRY_END -- 2.47.3