]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix tests to use new common.sh functions, wait_logfile and
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 6 Dec 2023 15:32:06 +0000 (16:32 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 6 Dec 2023 15:32:06 +0000 (16:32 +0100)
  kill_from_pidfile.

doc/Changelog
testdata/cachedb_no_store.tdir/cachedb_no_store.post
testdata/cachedb_no_store.tdir/cachedb_no_store.test
testdata/padding.tdir/padding.post
testdata/padding.tdir/padding.test
testdata/tcp_reuse.tdir/tcp_reuse.post
testdata/tls_reuse.tdir/tls_reuse.post

index d47f4f19050612e2bc1cffd1048d30eabc7cdd9b..ff674348b306e8e29bd805753a233723ec9e524a 100644 (file)
@@ -3,6 +3,8 @@
        - iana portlist update.
        - Updated IPv4 and IPv6 address for b.root-servers.net in root hints.
        - Update test script file common.sh.
+       - Fix tests to use new common.sh functions, wait_logfile and
+         kill_from_pidfile.
 
 5 December 2023: Wouter
        - Merge #971: fix 'WARNING: Message has 41 extra bytes at end'.
index 901f01a8753db5f088b8c0012bffadab2d48a703..320dcc3e3e3bb5d4f86b7546e72ec2331159fe02 100644 (file)
@@ -16,5 +16,5 @@ if test -f fwd4.log; then cat fwd4.log; else echo "no fwd4.log"; fi
 cat unbound.log
 if test -f unbound2.log; then cat unbound2.log; else echo "no unbound2.log"; fi
 kill_pid $FWD_PID
-kill_pid `cat unbound.pid`
+kill_from_pidfile "unbound.pid"
 rm -f $CONTROL_PATH/controlpipe.$CONTROL_PID
index 597b80e1ad6bfba93745261c9edaf3160925c4bd..47a89656c6c2393dd485c49e326dc29c010e44ce 100644 (file)
@@ -69,7 +69,7 @@ wait_ldns_testns_up fwd3.log
 
 # stop unbound to flush the cachedb cache
 echo "> stop unbound"
-kill_pid `cat unbound.pid`
+kill_from_pidfile "unbound.pid"
 
 echo ""
 echo "> config unbound with cachedb-no-store: yes"
index 9121ccf257ebe9df725a551582af575b42c4d4e6..eaeefb8c4fe1594d5bc164341fa55f52407ee2e0 100644 (file)
@@ -9,13 +9,13 @@
 PRE="../.."
 kill_pid $DNSTAP_SOCKET_PID
 kill_pid $FWD_PID
-kill_pid `cat unbound2.pid`
+kill_from_pidfile "unbound2.pid"
 if test -f unbound2.log; then
        echo ">>> upstream log"
        cat unbound2.log
 fi
 #kill_pid $UNBOUND_PID
-kill_pid `cat unbound.pid`
+kill_from_pidfile "unbound.pid"
 if test -f unbound.log; then
        echo ">>> unbound log"
        cat unbound.log
index 6161a49ae25d6e1b7b3aa8089a9232140ac6377b..2a0860851fa0406c6d2c9815a472f2cc8c8811e0 100644 (file)
@@ -25,17 +25,10 @@ else
         exit 1
 fi
 
-echo "> wait for log to happen on timer"
-sleep 3
+echo "> wait for log to happen"
+wait_logfile tap.log "www.example.com" 45
 echo "> check tap.log for dnstap info"
 # see if it logged the information in tap.log
-# wait for a moment for filesystem to catch up.
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 10; fi
 if grep "www.example.com" tap.log; then echo "yes it is in tap.log";
 else
         echo "information not in tap.log"
@@ -67,12 +60,7 @@ fi
 echo "> check tap.log for dnstap info"
 # see if it logged the information in tap.log
 # wait for a moment for filesystem to catch up.
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 10; fi
+wait_logfile tap.log "txt.example.com" 45
 if grep "txt.example.com" tap.log; then echo "yes it is in tap.log";
 else
         echo "information not in tap.log"
@@ -131,12 +119,7 @@ dig @127.0.0.1 -p $UNBOUND_PORT fin.example.com. TXT | tee outfile
 echo "> check tap.log for dnstap info"
 # see if it logged the information in tap.log
 # wait for a moment for filesystem to catch up.
-if grep "fini" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "fini" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "fini" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "fini" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "fini" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "fini" tap.log >/dev/null; then :; else sleep 10; fi
+wait_logfile tap.log "fini" 45
 if grep "fini" tap.log; then echo "yes it is in tap.log";
 else
         echo "information not in tap.log"
index ca75354714ed6b9fb8f3629e2555278076cfcce0..7536918b7666386c9efb6601060ebb62a577bced 100644 (file)
@@ -6,13 +6,13 @@
 #
 # do your teardown here
 . ../common.sh
-kill_pid `cat unbound2.pid`
+kill_from_pidfile "unbound2.pid"
 if test -f unbound2.log; then
        echo ">>> upstream log"
        cat unbound2.log
 fi
 #kill_pid $UNBOUND_PID
-kill_pid `cat unbound.pid`
+kill_from_pidfile "unbound.pid"
 if test -f unbound.log; then
        echo ">>> unbound log"
        cat unbound.log
index 2eef0da96233bd03d6483eba8ac04b0d2446302e..6162086e8edec5511d8cc6d1106b899ba992d247 100644 (file)
@@ -6,13 +6,13 @@
 #
 # do your teardown here
 . ../common.sh
-kill_pid `cat unbound2.pid`
+kill_from_pidfile "unbound2.pid"
 if test -f unbound2.log; then
        echo ">>> upstream log"
        cat unbound2.log
 fi
 #kill_pid $UNBOUND_PID
-kill_pid `cat unbound.pid`
+kill_from_pidfile "unbound.pid"
 if test -f unbound.log; then
        echo ">>> unbound log"
        cat unbound.log