]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use $n to keep diagnostic output of every individual test separate
authorOndřej Surý <ondrej@isc.org>
Fri, 6 Dec 2019 10:07:28 +0000 (11:07 +0100)
committerMichał Kępień <michal@isc.org>
Fri, 10 Jan 2020 08:08:21 +0000 (09:08 +0100)
(cherry picked from commit 10f4cd066fbc3b84ae917f21ef608ed5759159a8)

bin/tests/system/forward/tests.sh

index d45c7b84baafe6f2eacfc1ec5e5dfe11c1d5455b..a35403fab584aea84e66eddb73805fe47a7de3de 100644 (file)
@@ -24,71 +24,71 @@ n=0
 n=$((n+1))
 echo_i "checking that a forward zone overrides global forwarders ($n)"
 ret=0
-$DIG $DIGOPTS +noadd +noauth txt.example1. txt @$hidden > dig.out.hidden || ret=1
-$DIG $DIGOPTS +noadd +noauth txt.example1. txt @$f1 > dig.out.f1 || ret=1
-digcomp dig.out.hidden dig.out.f1 || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example1. txt @$hidden > dig.out.$n.hidden || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example1. txt @$f1 > dig.out.$n.f1 || ret=1
+digcomp dig.out.$n.hidden dig.out.$n.f1 || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
 n=$((n+1))
 echo_i "checking that a forward first zone no forwarders recurses ($n)"
 ret=0
-$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$root > dig.out.root || ret=1
-$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$f1 > dig.out.f1 || ret=1
-digcomp dig.out.root dig.out.f1 || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$root > dig.out.$n.root || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$f1 > dig.out.$n.f1 || ret=1
+digcomp dig.out.$n.root dig.out.$n.f1 || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
 n=$((n+1))
 echo_i "checking that a forward only zone no forwarders fails ($n)"
 ret=0
-$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$root > dig.out.root || ret=1
-$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$f1 > dig.out.f1 || ret=1
-digcomp dig.out.root dig.out.f1 || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$root > dig.out.$n.root || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$f1 > dig.out.$n.f1 || ret=1
+digcomp dig.out.$n.root dig.out.$n.f1 || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
 n=$((n+1))
 echo_i "checking that global forwarders work ($n)"
 ret=0
-$DIG $DIGOPTS +noadd +noauth txt.example4. txt @$hidden > dig.out.hidden || ret=1
-$DIG $DIGOPTS +noadd +noauth txt.example4. txt @$f1 > dig.out.f1 || ret=1
-digcomp dig.out.hidden dig.out.f1 || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example4. txt @$hidden > dig.out.$n.hidden || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example4. txt @$f1 > dig.out.$n.f1 || ret=1
+digcomp dig.out.$n.hidden dig.out.$n.f1 || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
 n=$((n+1))
 echo_i "checking that a forward zone works ($n)"
 ret=0
-$DIG $DIGOPTS +noadd +noauth txt.example1. txt @$hidden > dig.out.hidden || ret=1
-$DIG $DIGOPTS +noadd +noauth txt.example1. txt @$f2 > dig.out.f2 || ret=1
-digcomp dig.out.hidden dig.out.f2 || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example1. txt @$hidden > dig.out.$n.hidden || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example1. txt @$f2 > dig.out.$n.f2 || ret=1
+digcomp dig.out.$n.hidden dig.out.$n.f2 || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
 n=$((n+1))
 echo_i "checking that forwarding doesn't spontaneously happen ($n)"
 ret=0
-$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$root > dig.out.root || ret=1
-$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$f2 > dig.out.f2 || ret=1
-digcomp dig.out.root dig.out.f2 || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$root > dig.out.$n.root || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example2. txt @$f2 > dig.out.$n.f2 || ret=1
+digcomp dig.out.$n.root dig.out.$n.f2 || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
 n=$((n+1))
 echo_i "checking that a forward zone with no specified policy works ($n)"
 ret=0
-$DIG $DIGOPTS +noadd +noauth txt.example3. txt @$hidden > dig.out.hidden || ret=1
-$DIG $DIGOPTS +noadd +noauth txt.example3. txt @$f2 > dig.out.f2 || ret=1
-digcomp dig.out.hidden dig.out.f2 || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example3. txt @$hidden > dig.out.$n.hidden || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example3. txt @$f2 > dig.out.$n.f2 || ret=1
+digcomp dig.out.$n.hidden dig.out.$n.f2 || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
 n=$((n+1))
 echo_i "checking that a forward only doesn't recurse ($n)"
 ret=0
-$DIG $DIGOPTS txt.example5. txt @$f2 > dig.out.f2 || ret=1
-grep "SERVFAIL" dig.out.f2 > /dev/null || ret=1
+$DIG $DIGOPTS txt.example5. txt @$f2 > dig.out.$n.f2 || ret=1
+grep "SERVFAIL" dig.out.$n.f2 > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
@@ -97,11 +97,11 @@ echo_i "checking for negative caching of forwarder response ($n)"
 # prime the cache, shutdown the forwarder then check that we can
 # get the answer from the cache.  restart forwarder.
 ret=0
-$DIG $DIGOPTS nonexist. txt @10.53.0.5 > dig.out.f2 || ret=1
-grep "status: NXDOMAIN" dig.out.f2 > /dev/null || ret=1
+$DIG $DIGOPTS nonexist. txt @10.53.0.5 > dig.out.$n.f2 || ret=1
+grep "status: NXDOMAIN" dig.out.$n.f2 > /dev/null || ret=1
 $PERL ../stop.pl forward ns4 || ret=1
-$DIG $DIGOPTS nonexist. txt @10.53.0.5 > dig.out.f2 || ret=1
-grep "status: NXDOMAIN" dig.out.f2 > /dev/null || ret=1
+$DIG $DIGOPTS nonexist. txt @10.53.0.5 > dig.out.$n.f2 || ret=1
+grep "status: NXDOMAIN" dig.out.$n.f2 > /dev/null || ret=1
 $PERL ../start.pl --restart --noclean --port ${PORT} forward ns4 || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
@@ -109,24 +109,24 @@ status=`expr $status + $ret`
 n=$((n+1))
 echo_i "checking that forward only zone overrides empty zone ($n)"
 ret=0
-$DIG $DIGOPTS 1.0.10.in-addr.arpa TXT @10.53.0.4 > dig.out.f2
-grep "status: NOERROR" dig.out.f2 > /dev/null || ret=1
-$DIG $DIGOPTS 2.0.10.in-addr.arpa TXT @10.53.0.4 > dig.out.f2
-grep "status: NXDOMAIN" dig.out.f2 > /dev/null || ret=1
+$DIG $DIGOPTS 1.0.10.in-addr.arpa TXT @10.53.0.4 > dig.out.$n.f2
+grep "status: NOERROR" dig.out.$n.f2 > /dev/null || ret=1
+$DIG $DIGOPTS 2.0.10.in-addr.arpa TXT @10.53.0.4 > dig.out.$n.f2
+grep "status: NXDOMAIN" dig.out.$n.f2 > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
 n=$((n+1))
 echo_i "checking that DS lookups for grafting forward zones are isolated ($n)"
 ret=0
-$DIG $DIGOPTS grafted A @10.53.0.4 > dig.out.q1
-$DIG $DIGOPTS grafted DS @10.53.0.4 > dig.out.q2
-$DIG $DIGOPTS grafted A @10.53.0.4 > dig.out.q3
-$DIG $DIGOPTS grafted AAAA @10.53.0.4 > dig.out.q4
-grep "status: NOERROR" dig.out.q1 > /dev/null || ret=1
-grep "status: NXDOMAIN" dig.out.q2 > /dev/null || ret=1
-grep "status: NOERROR" dig.out.q3 > /dev/null || ret=1
-grep "status: NOERROR" dig.out.q4 > /dev/null || ret=1
+$DIG $DIGOPTS grafted A @10.53.0.4 > dig.out.$n.q1
+$DIG $DIGOPTS grafted DS @10.53.0.4 > dig.out.$n.q2
+$DIG $DIGOPTS grafted A @10.53.0.4 > dig.out.$n.q3
+$DIG $DIGOPTS grafted AAAA @10.53.0.4 > dig.out.$n.q4
+grep "status: NOERROR" dig.out.$n.q1 > /dev/null || ret=1
+grep "status: NXDOMAIN" dig.out.$n.q2 > /dev/null || ret=1
+grep "status: NOERROR" dig.out.$n.q3 > /dev/null || ret=1
+grep "status: NOERROR" dig.out.$n.q4 > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
@@ -155,7 +155,7 @@ echo "//" | $SENDCMD
 # and is delegated from the root to check whether the forwarder will be retried
 # when a delegation is encountered after falling back to full recursive
 # resolution.
-$DIG $DIGOPTS txt.example7. txt @$f1 > dig.out.f1 || ret=1
+$DIG $DIGOPTS txt.example7. txt @$f1 > dig.out.$n.f1 || ret=1
 # The forwarder for the "example7" zone should only be queried once.
 sent=`tr -d '\r' < ns3/named.run | sed -n '/sending packet to 10.53.0.6/,/^$/p' | grep ";txt.example7.*IN.*TXT" | wc -l`
 if [ $sent -ne 1 ]; then ret=1; fi
@@ -165,7 +165,7 @@ status=`expr $status + $ret`
 n=$((n+1))
 echo_i "checking that priming queries are not forwarded ($n)"
 ret=0
-$DIG $DIGOPTS +noadd +noauth txt.example1. txt @10.53.0.7 > dig.out.f7 || ret=1
+$DIG $DIGOPTS +noadd +noauth txt.example1. txt @10.53.0.7 > dig.out.$n.f7 || ret=1
 sent=`tr -d '\r' < ns7/named.run | sed -n '/sending packet to 10.53.0.1/,/^$/p' | grep ";.*IN.*NS" | wc -l`
 [ $sent -eq 1 ] || ret=1
 sent=`grep "10.53.0.7#.* (.): query '\./NS/IN' approved" ns4/named.run | wc -l`
@@ -178,8 +178,8 @@ status=`expr $status + $ret`
 n=$((n+1))
 echo_i "checking recovery from forwarding to a non-recursive server ($n)"
 ret=0
-$DIG $DIGOPTS xxx.sld.tld txt @10.53.0.8  > dig.out.f8
-grep "status: NOERROR" dig.out.f8 > /dev/null || ret=1
+$DIG $DIGOPTS xxx.sld.tld txt @10.53.0.8  > dig.out.$n.f8
+grep "status: NOERROR" dig.out.$n.f8 > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`