]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[rt46602] Update server-stale test to run on port passed from run.sh script
authorOndřej Surý <ondrej@sury.org>
Wed, 18 Oct 2017 11:01:14 +0000 (13:01 +0200)
committerStephen Morris <stephen@isc.org>
Fri, 16 Feb 2018 14:57:50 +0000 (14:57 +0000)
bin/tests/system/serve-stale/ans2/ans.pl.in [moved from bin/tests/system/serve-stale/ans2/ans.pl with 99% similarity]
bin/tests/system/serve-stale/clean.sh
bin/tests/system/serve-stale/ns1/named1.conf.in [moved from bin/tests/system/serve-stale/ns1/named1.conf with 88% similarity]
bin/tests/system/serve-stale/ns1/named2.conf.in [moved from bin/tests/system/serve-stale/ns1/named2.conf with 88% similarity]
bin/tests/system/serve-stale/ns3/named.conf.in [moved from bin/tests/system/serve-stale/ns3/named.conf with 88% similarity]
bin/tests/system/serve-stale/setup.sh
bin/tests/system/serve-stale/tests.sh

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 9f95460dbf450c6ac0035a1c1ee4f8d24cb76327..3d2da5aaf7a8613fffa68980234c47d57aebc839 100644 (file)
@@ -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;
 
 #
index 15e23bb343221eb134f7c97f80c4a029811adc14..5d073079d346c0036f7fb5659549de258e166e7e 100644 (file)
@@ -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*
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 21fc39900dca31f8ab8eda9e793d09a2570901e0..9b9004ec3c87fbf2cf78f67c11d7ad40fd06a041 100644 (file)
@@ -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; };
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 a481fd8a99105c74233713e9aa58fb7c979ee19c..d6945d56d0ccbcb97f64caf69ad51eaa6ac0ade0 100644 (file)
@@ -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; };
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 88bd08ce478a79883da363558b93783b360b0b68..c4a1893e533bd53a73c59ac926e1efb052c4391a 100644 (file)
@@ -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; };
index cd75f4f82e0807656756b29011f9c365ee18567a..c709808b92fc59266d7d8bf1d180c3da8e50b2a0 100644 (file)
@@ -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
index c4dfd53d3b984942e6682dfc7a97653b6a0b18a4..18cb11b69f7dd5769f8f7fa46509d1c052645079 100755 (executable)
@@ -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