3846. [bug] "dig +notcp ixfr=<serial>" should result in a UDP

ixfr query. [RT #35980]
This commit is contained in:
Mark Andrews
2014-05-14 09:59:02 +10:00
parent 5cef2421bd
commit 05816676bb
7 changed files with 38 additions and 9 deletions

View File

@@ -21,5 +21,5 @@ rm -f ns1/named.conf ns1/myftp.db
rm -f ns3/*.jnl ns3/mytest.db ns3/subtest.db
rm -f ns4/*.jnl ns4/*.db
rm -f */named.memstats
rm -f dig.out
rm -f dig.out dig.out1 dig.out2 dig.out3
rm -f ns3/large.db

View File

@@ -249,5 +249,21 @@ test ${lines:-0} -eq 2 || { echo "I:failed"; status=1; }
messages=`sed -n 's/^;;.*messages \([0-9]*\),.*/\1/p' dig.out`
test ${messages:-0} -gt 1 || { echo "I:failed"; status=1; }
echo "I:test 'dig +notcp ixfr=<value>' vs 'dig ixfr=<value> +notcp' vs 'dig ixfr=<value>'"
ret=0
# Should be "switch to TCP" response
$DIG +notcp ixfr=1 test -p 5300 @10.53.0.4 > dig.out1 || ret=1
$DIG ixfr=1 +notcp test -p 5300 @10.53.0.4 > dig.out2 || ret=1
$PERL ../digcomp.pl dig.out1 dig.out2 || ret=1
awk '$4 == "SOA" { soacnt++} END {exit(soacnt == 1 ? 0 : 1);}' dig.out1 || ret=1
awk '$4 == "SOA" { exit($7 == 4 ? 0 : 1);}' dig.out1 || ret=1
# Should be incremental transfer.
$DIG ixfr=1 test -p 5300 @10.53.0.4 > dig.out3 || ret=1
awk '$4 == "SOA" { soacnt++} END {exit(soacnt == 6 ? 0 : 1);}' dig.out3 || ret=1
if [ ${ret} != 0 ]; then
echo "I:failed";
status=1;
fi
echo "I:exit status: $status"
exit $status