From: Ondřej Surý Date: Wed, 18 Oct 2017 11:01:14 +0000 (+0200) Subject: [rt46602] Update server-stale test to run on port passed from run.sh script X-Git-Tag: v9.13.0~158^2~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f83ebd34b9555a5a834c58146035173bcbd01dda;p=thirdparty%2Fbind9.git [rt46602] Update server-stale test to run on port passed from run.sh script --- diff --git a/bin/tests/system/serve-stale/ans2/ans.pl b/bin/tests/system/serve-stale/ans2/ans.pl.in similarity index 99% rename from bin/tests/system/serve-stale/ans2/ans.pl rename to bin/tests/system/serve-stale/ans2/ans.pl.in index 9f95460dbf4..3d2da5aaf7a 100644 --- a/bin/tests/system/serve-stale/ans2/ans.pl +++ b/bin/tests/system/serve-stale/ans2/ans.pl.in @@ -25,7 +25,7 @@ $SIG{TERM} = \&rmpid; my $send_response = 1; my $localaddr = "10.53.0.2"; -my $localport = 5300; +my $localport = @PORT@; my $verbose = 0; # diff --git a/bin/tests/system/serve-stale/clean.sh b/bin/tests/system/serve-stale/clean.sh index 15e23bb3432..5d073079d34 100644 --- a/bin/tests/system/serve-stale/clean.sh +++ b/bin/tests/system/serve-stale/clean.sh @@ -5,6 +5,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. rm -f dig.out.test* -rm -f ns1/named.conf +rm -f ns1/named.conf ns1/named.port +rm -f ans2/ans.pl ans2/named.port +rm -f ns3/named.conf ns3/named.port rm -f ns3/root.bk rm -f rndc.out.test* diff --git a/bin/tests/system/serve-stale/ns1/named1.conf b/bin/tests/system/serve-stale/ns1/named1.conf.in similarity index 88% rename from bin/tests/system/serve-stale/ns1/named1.conf rename to bin/tests/system/serve-stale/ns1/named1.conf.in index 21fc39900dc..9b9004ec3c8 100644 --- a/bin/tests/system/serve-stale/ns1/named1.conf +++ b/bin/tests/system/serve-stale/ns1/named1.conf.in @@ -12,14 +12,14 @@ key rndc_key { }; controls { - inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; }; + inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; }; options { query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; - port 5300; + port @PORT@; pid-file "named.pid"; listen-on { 10.53.0.1; }; listen-on-v6 { none; }; diff --git a/bin/tests/system/serve-stale/ns1/named2.conf b/bin/tests/system/serve-stale/ns1/named2.conf.in similarity index 88% rename from bin/tests/system/serve-stale/ns1/named2.conf rename to bin/tests/system/serve-stale/ns1/named2.conf.in index a481fd8a991..d6945d56d0c 100644 --- a/bin/tests/system/serve-stale/ns1/named2.conf +++ b/bin/tests/system/serve-stale/ns1/named2.conf.in @@ -12,14 +12,14 @@ key rndc_key { }; controls { - inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; }; + inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; }; options { query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; - port 5300; + port @PORT@; pid-file "named.pid"; listen-on { 10.53.0.1; }; listen-on-v6 { none; }; diff --git a/bin/tests/system/serve-stale/ns3/named.conf b/bin/tests/system/serve-stale/ns3/named.conf.in similarity index 88% rename from bin/tests/system/serve-stale/ns3/named.conf rename to bin/tests/system/serve-stale/ns3/named.conf.in index 88bd08ce478..c4a1893e533 100644 --- a/bin/tests/system/serve-stale/ns3/named.conf +++ b/bin/tests/system/serve-stale/ns3/named.conf.in @@ -12,14 +12,14 @@ key rndc_key { }; controls { - inet 10.53.0.3 port 9953 allow { any; } keys { rndc_key; }; + inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; }; options { query-source address 10.53.0.3; notify-source 10.53.0.3; transfer-source 10.53.0.3; - port 5300; + port @PORT@; pid-file "named.pid"; listen-on { 10.53.0.3; }; listen-on-v6 { none; }; diff --git a/bin/tests/system/serve-stale/setup.sh b/bin/tests/system/serve-stale/setup.sh index cd75f4f82e0..c709808b92f 100644 --- a/bin/tests/system/serve-stale/setup.sh +++ b/bin/tests/system/serve-stale/setup.sh @@ -1,7 +1,17 @@ +#!/bin/sh # Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -cp -f ns1/named1.conf ns1/named.conf +. ../getopts.sh + +sed -e "s/@PORT@/${port}/g;s/@CONTROLPORT@/${controlport}/g" < ns1/named1.conf.in > ns1/named.conf +echo "${port}" > ns1/named.port + +sed -e "s/@PORT@/${port}/g;s/@CONTROLPORT@/${controlport}/g" < ans2/ans.pl.in > ans2/ans.pl +echo "${port}" > ans2/named.port + +sed -e "s/@PORT@/${port}/g;s/@CONTROLPORT@/${controlport}/g" < ns3/named.conf.in > ns3/named.conf +echo "${port}" > ns3/named.port diff --git a/bin/tests/system/serve-stale/tests.sh b/bin/tests/system/serve-stale/tests.sh index c4dfd53d3b9..18cb11b69f7 100755 --- a/bin/tests/system/serve-stale/tests.sh +++ b/bin/tests/system/serve-stale/tests.sh @@ -9,29 +9,41 @@ SYSTEMTESTTOP=.. . $SYSTEMTESTTOP/conf.sh -RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p 9953 -s" +. ../getopts.sh + +while getopts "p:c:" flag; do + case "$flag" in + p) port=$OPTARG ;; + c) controlport=$OPTARG ;; + *) exit 1 ;; + esac +done + +RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${controlport} -s" + +echo "RNDCCMD: ${RNDCCMD}" status=0 n=0 #echo "I:check ans.pl server ($n)" -#$DIG -p 5300 @10.53.0.2 example NS -#$DIG -p 5300 @10.53.0.2 example SOA -#$DIG -p 5300 @10.53.0.2 ns.example A -#$DIG -p 5300 @10.53.0.2 ns.example AAAA -#$DIG -p 5300 @10.53.0.2 txt enable -#$DIG -p 5300 @10.53.0.2 txt disable -#$DIG -p 5300 @10.53.0.2 ns.example AAAA -#$DIG -p 5300 @10.53.0.2 txt enable -#$DIG -p 5300 @10.53.0.2 ns.example AAAA -##$DIG -p 5300 @10.53.0.2 data.example TXT -#$DIG -p 5300 @10.53.0.2 nodata.example TXT -#$DIG -p 5300 @10.53.0.2 nxdomain.example TXT +#$DIG -p ${port} @10.53.0.2 example NS +#$DIG -p ${port} @10.53.0.2 example SOA +#$DIG -p ${port} @10.53.0.2 ns.example A +#$DIG -p ${port} @10.53.0.2 ns.example AAAA +#$DIG -p ${port} @10.53.0.2 txt enable +#$DIG -p ${port} @10.53.0.2 txt disable +#$DIG -p ${port} @10.53.0.2 ns.example AAAA +#$DIG -p ${port} @10.53.0.2 txt enable +#$DIG -p ${port} @10.53.0.2 ns.example AAAA +##$DIG -p ${port} @10.53.0.2 data.example TXT +#$DIG -p ${port} @10.53.0.2 nodata.example TXT +#$DIG -p ${port} @10.53.0.2 nxdomain.example TXT n=`expr $n + 1` echo "I:prime cache data.example ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 data.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -40,7 +52,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:prime cache nodata.example ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nodata.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -49,7 +61,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:prime cache nxdomain.example ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nxdomain.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -58,7 +70,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:disable responses from authoritative server ($n)" ret=0 -$DIG -p 5300 @10.53.0.2 txt disable > dig.out.test$n +$DIG -p ${port} @10.53.0.2 txt disable > dig.out.test$n grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 grep "TXT.\"0\"" dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -77,7 +89,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale data.example ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 data.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -86,7 +98,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nodata.example ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nodata.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -95,7 +107,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nxdomain.example ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nxdomain.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -119,7 +131,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale data.example (serve-stale off) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 data.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` @@ -129,7 +141,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nodata.example (serve-stale off) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nodata.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` @@ -137,7 +149,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nxdomain.example (serve-stale off) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nxdomain.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` @@ -160,7 +172,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale data.example (serve-stale on) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 data.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -169,7 +181,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nodata.example (serve-stale on) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nodata.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -178,7 +190,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nxdomain.example (serve-stale on) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nxdomain.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -202,7 +214,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale data.example (serve-stale no) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 data.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` @@ -212,7 +224,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nodata.example (serve-stale no) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nodata.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` @@ -220,7 +232,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nxdomain.example (serve-stale no) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nxdomain.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` @@ -243,7 +255,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale data.example (serve-stale yes) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 data.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -252,7 +264,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nodata.example (serve-stale yes) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nodata.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -261,7 +273,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nxdomain.example (serve-stale yes) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nxdomain.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -292,7 +304,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale data.example (serve-stale reset) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 data.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -301,7 +313,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nodata.example (serve-stale reset) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nodata.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -310,7 +322,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check stale nxdomain.example (serve-stale reset) ($n)" ret=0 -$DIG -p 5300 @10.53.0.1 nxdomain.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -334,7 +346,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:updating ns1/named.conf ($n)" ret=0 -cp -f ns1/named2.conf ns1/named.conf || ret=1 +sed -e "s/@PORT@/${port}/g;s/@CONTROLPORT@/${controlport}/g" < ns1/named2.conf.in > ns1/named.conf if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` @@ -373,7 +385,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:enable responses from authoritative server ($n)" ret=0 -$DIG -p 5300 @10.53.0.2 txt enable > dig.out.test$n +$DIG -p ${port} @10.53.0.2 txt enable > dig.out.test$n grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 grep "TXT.\"1\"" dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -382,7 +394,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:prime cache data.example (max-stale-ttl default) ($n)" ret=0 -$DIG -p 5300 @10.53.0.3 data.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.3 data.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -391,7 +403,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:prime cache nodata.example (max-stale-ttl default) ($n)" ret=0 -$DIG -p 5300 @10.53.0.3 nodata.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.3 nodata.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -400,7 +412,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:prime cache nxdomain.example (max-stale-ttl default) ($n)" ret=0 -$DIG -p 5300 @10.53.0.3 nxdomain.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.3 nxdomain.example TXT > dig.out.test$n grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -409,7 +421,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:disable responses from authoritative server ($n)" ret=0 -$DIG -p 5300 @10.53.0.2 txt disable > dig.out.test$n +$DIG -p ${port} @10.53.0.2 txt disable > dig.out.test$n grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 grep "TXT.\"0\"" dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -428,7 +440,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check fail of data.example (max-stale-ttl default) ($n)" ret=0 -$DIG -p 5300 @10.53.0.3 data.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.3 data.example TXT > dig.out.test$n grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -437,7 +449,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check fail of nodata.example (max-stale-ttl default) ($n)" ret=0 -$DIG -p 5300 @10.53.0.3 nodata.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.3 nodata.example TXT > dig.out.test$n grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -446,7 +458,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check fail of nxdomain.example (max-stale-ttl default) ($n)" ret=0 -$DIG -p 5300 @10.53.0.3 nxdomain.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.3 nxdomain.example TXT > dig.out.test$n grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -470,7 +482,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check data.example (max-stale-ttl default) ($n)" ret=0 -$DIG -p 5300 @10.53.0.3 data.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.3 data.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -479,7 +491,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check nodata.example (max-stale-ttl default) ($n)" ret=0 -$DIG -p 5300 @10.53.0.3 nodata.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.3 nodata.example TXT > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi @@ -488,7 +500,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:check nxdomain.example (max-stale-ttl default) ($n)" ret=0 -$DIG -p 5300 @10.53.0.3 nxdomain.example TXT > dig.out.test$n +$DIG -p ${port} @10.53.0.3 nxdomain.example TXT > dig.out.test$n grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi