]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix unbound-control test so it counts the new flush_negative output,
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 2 Apr 2025 13:52:20 +0000 (15:52 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 2 Apr 2025 13:52:20 +0000 (15:52 +0200)
  also answers the _ta probe from testns and prints command output
  and skip a thread specific test when no threads are available.

doc/Changelog
testdata/09-unbound-control.tdir/09-unbound-control.test
testdata/09-unbound-control.tdir/09-unbound-control.testns

index 321a3b9b7dcccfeeaf656db921b16675b06c8af1..fff1cc51d38ad03951f5272579728b51ea9c359c 100644 (file)
@@ -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.
index 80f64c978196bf5eaf07ded6f677b70c74ca9593..da284c2c0ccdcff9bacba1044b436ecb45dec1f9 100644 (file)
@@ -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
index 44466b4da613b3a32629046923b8eb1aa5ab7542..311af0f7e7719c32c917b8aadac2c65a1e6fb81c 100644 (file)
@@ -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