]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Rewrap comments to 80 char width serve-stale test
authorMatthijs Mekking <matthijs@isc.org>
Fri, 22 Jan 2021 12:33:22 +0000 (13:33 +0100)
committerDiego Fronza <diego@isc.org>
Mon, 25 Jan 2021 13:48:16 +0000 (10:48 -0300)
bin/tests/system/serve-stale/tests.sh

index 8e009c383946fadbf80bef46d8de210ebde4b970..92263d86dff617df45bf4ae7821ef6f2189b149c 100755 (executable)
@@ -547,8 +547,8 @@ grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
-# keep track of time so we can access these rrset later,
-# when we expect them to become ancient.
+# Keep track of time so we can access these RRset later, when we expect them
+# to become ancient.
 t1=`$PERL -e 'print time()'`
 
 n=$((n+1))
@@ -643,16 +643,16 @@ grep "1 #NXDOMAIN" ns1/named.stats.$n.cachedb > /dev/null || ret=1
 status=$((status+ret))
 if [ $ret != 0 ]; then echo_i "failed"; fi
 
-# retrieve max-stale-ttl value,
+# Retrieve max-stale-ttl value.
 interval_to_ancient=`grep 'max-stale-ttl' ns1/named2.conf.in  | awk '{ print $2 }' | tr -d ';'`
-# we add 2 seconds to it since this is the ttl value of the records being tested.
+# We add 2 seconds to it since this is the ttl value of the records being
+# tested.
 interval_to_ancient=$((interval_to_ancient + 2))
 t2=`$PERL -e 'print time()'`
 elapsed=$((t2 - t1))
 
-# if elapsed time so far is less than max-stale-ttl + 2 seconds,
-# then we sleep enough to ensure that we'll ask for ancient rrsets
-# in the next queries.
+# If elapsed time so far is less than max-stale-ttl + 2 seconds, then we sleep
+# enough to ensure that we'll ask for ancient RRsets in the next queries.
 if [ $elapsed -lt $interval_to_ancient ]; then
     sleep $((interval_to_ancient - elapsed))
 fi
@@ -1039,8 +1039,8 @@ $RNDCCMD 10.53.0.3 stats > /dev/null 2>&1
 [ -f ns3/named.stats ] || ret=1
 cp ns3/named.stats ns3/named.stats.$n
 # Check first 10 lines of Cache DB statistics. After last queries, we expect
-# one active TXT RRset, one stale TXT, one stale nxrrset TXT, and one
-# stale NXDOMAIN.
+# one active TXT RRset, one stale TXT, one stale nxrrset TXT, and one stale
+# NXDOMAIN.
 grep -A 10 "++ Cache DB RRsets ++" ns3/named.stats.$n > ns3/named.stats.$n.cachedb || ret=1
 grep "1 TXT" ns3/named.stats.$n.cachedb > /dev/null || ret=1
 grep "1 #TXT" ns3/named.stats.$n.cachedb > /dev/null || ret=1
@@ -1259,8 +1259,8 @@ $RNDCCMD 10.53.0.4 stats > /dev/null 2>&1
 [ -f ns4/named.stats ] || ret=1
 cp ns4/named.stats ns4/named.stats.$n
 # Check first 10 lines of Cache DB statistics. After last queries, we expect
-# one active TXT RRset, one stale TXT, one stale nxrrset TXT, and one
-# stale NXDOMAIN.
+# one active TXT RRset, one stale TXT, one stale nxrrset TXT, and one stale
+# NXDOMAIN.
 grep -A 10 "++ Cache DB RRsets ++" ns4/named.stats.$n > ns4/named.stats.$n.cachedb || ret=1
 grep "1 TXT" ns4/named.stats.$n.cachedb > /dev/null || ret=1
 grep "1 #TXT" ns4/named.stats.$n.cachedb > /dev/null || ret=1
@@ -1281,9 +1281,9 @@ status=$((status+ret))
 echo_i "stop ns4"
 $PERL ../stop.pl --use-rndc --port ${CONTROLPORT} serve-stale ns4
 
-# Load the cache as if it was five minutes (RBTDB_VIRTUAL) older.
-# Since max-stale-ttl defaults to a week, we need to adjust the date by
-# one week and five minutes.
+# Load the cache as if it was five minutes (RBTDB_VIRTUAL) older. Since
+# max-stale-ttl defaults to a week, we need to adjust the date by one week and
+# five minutes.
 LASTWEEK=`TZ=UTC perl -e 'my $now = time();
         my $oneWeekAgo = $now - 604800;
         my $fiveMinutesAgo = $oneWeekAgo - 300;
@@ -1640,21 +1640,19 @@ $DIG -p ${PORT} +tries=1 +timeout=3  @10.53.0.3 nodata.example TXT > dig.out.tes
 $DIG -p ${PORT} +tries=1 +timeout=30  @10.53.0.3 nodata.example TXT > dig.out.test$((n+2))
 wait
 
-# Since nodata.example is cached as NXRRSET and marked as
-# stale at this point, BIND must not return this RRset when
-# stale-answer-client-timeout triggers, instead, it must attempt
-# to refresh the RRset.
-# Since the authoritative server is disabled and we are using
-# resolver-query-timeout value of 10 seconds, we expect this
-# query with a timeout of 3 seconds to time out.
+# Since nodata.example is cached as NXRRSET and marked as stale at this point,
+# BIND must not return this RRset when stale-answer-client-timeout triggers,
+# instead, it must attempt to refresh the RRset. Since the authoritative
+# server is disabled and we are using resolver-query-timeout value of 10
+# seconds, we expect this query with a timeout of 3 seconds to time out.
 n=$((n+1))
 echo_i "check query for nodata.example times out (default stale-answer-client-timeout) ($n)"
 grep "connection timed out" dig.out.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
-# For this query we expect BIND to return stale NXRRSET data
-# for nodata.example after resolver-query-timeout expires.
+# For this query we expect BIND to return stale NXRRSET data for
+# nodata.example after resolver-query-timeout expires.
 n=$((n+1))
 echo_i "check stale nodata.example comes from cache after resolver-query-timeout expires (default stale-answer-client-timeout) ($n)"
 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
@@ -1682,10 +1680,10 @@ rndc_reload ns3 10.53.0.3
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
-# Send a query, auth server is disabled, we will enable it after
-# a while in order to receive an answer before resolver-query-timeout
-# expires. Since stale-answer-client-timeout is disabled we must receive
-# an answer from authoritative server.
+# Send a query, auth server is disabled, we will enable it after a while in
+# order to receive an answer before resolver-query-timeout expires. Since
+# stale-answer-client-timeout is disabled we must receive an answer from
+# authoritative server.
 echo_i "sending query for test $((n+2))"
 $DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$((n+2)) &
 sleep 3
@@ -1783,8 +1781,8 @@ wait_for_rrset_refresh() {
 }
 
 # This test ensures that after we get stale data due to
-# stale-answer-client-timeout 0, enabling the authoritative server
-# will allow the RRset to be updated.
+# stale-answer-client-timeout 0, enabling the authoritative server will allow
+# the RRset to be updated.
 n=$((n+1))
 ret=0
 echo_i "check stale data.example was refreshed (stale-answer-client-timeout 0) ($n)"
@@ -1810,21 +1808,20 @@ $DIG -p ${PORT} +tries=1 +timeout=3  @10.53.0.3 nodata.example TXT > dig.out.tes
 $DIG -p ${PORT} +tries=1 +timeout=30  @10.53.0.3 nodata.example TXT > dig.out.test$((n+2))
 wait
 
-# Since nodata.example is cached as NXRRSET and marked as
-# stale at this point, BIND must not prompty return this RRset
-# due to stale-answer-client-timeout == 0, instead, it must
-# attempt to refresh the RRset.
-# Since the authoritative server is disabled and we are using
-# resolver-query-timeout value of 10 seconds, we expect this
-# query with a timeout of 3 seconds to time out.
+# Since nodata.example is cached as NXRRSET and marked as stale at this point,
+# BIND must not prompty return this RRset due to
+# stale-answer-client-timeout == 0, instead, it must attempt to refresh the
+# RRset. Since the authoritative server is disabled and we are using
+# resolver-query-timeout value of 10 seconds, we expect this query with a
+# timeout of 3 seconds to time out.
 n=$((n+1))
 echo_i "check query for nodata.example times out (stale-answer-client-timeout 0) ($n)"
 grep "connection timed out" dig.out.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
-# For this query we expect BIND to return stale NXRRSET data
-# for nodata.example after resolver-query-timeout expires.
+# For this query we expect BIND to return stale NXRRSET data for
+# nodata.example after resolver-query-timeout expires.
 n=$((n+1))
 echo_i "check stale nodata.example comes from cache after resolver-query-timeout expires (stale-answer-client-timeout 0) ($n)"
 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
@@ -1906,8 +1903,8 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
 # This test ensures that after we get stale data due to
-# stale-answer-client-timeout 0, enabling the authoritative server
-# will allow the RRset to be updated.
+# stale-answer-client-timeout 0, enabling the authoritative server will allow
+# the RRset to be updated.
 n=$((n+1))
 ret=0
 echo_i "check stale data.example was refreshed (stale-answer-client-timeout 0 stale-refresh-time 4) ($n)"