3541. [bug] The parts if libdns was not being properly initialized

in when built in libexport mode. [RT #33028]
This commit is contained in:
Mark Andrews
2013-04-03 17:27:40 +11:00
parent 8c460e0159
commit 8013077aa7
14 changed files with 396 additions and 21 deletions

View File

@@ -30,17 +30,44 @@ grep "status: NXDOMAIN" dig.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ -x ${SAMPLE} ] ; then
echo "I:checking non-cachable NXDOMAIN response handling using dns_client"
ret=0
${SAMPLE} -p 5300 -t a 10.53.0.1 nxdomain.example.net 2> sample.out || ret=1
grep "resolution failed: ncache nxdomain" sample.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
echo "I:checking non-cachable NODATA response handling"
ret=0
$DIG +tcp nodata.example.net @10.53.0.1 a -p 5300 > dig.out || ret=1
grep "status: NOERROR" dig.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ -x ${SAMPLE} ] ; then
echo "I:checking non-cachable NODATA response handling using dns_client"
ret=0
${SAMPLE} -p 5300 -t a 10.53.0.1 nodata.example.net 2> sample.out || ret=1
grep "resolution failed: ncache nxrrset" sample.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
echo "I:checking handling of bogus referrals"
# If the server has the "INSIST(!external)" bug, this query will kill it.
$DIG +tcp www.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
if [ -x ${SAMPLE} ] ; then
echo "I:checking handling of bogus referrals using dns_client"
ret=0
${SAMPLE} -p 5300 -t a 10.53.0.1 www.example.com 2> sample.out || ret=1
grep "resolution failed: failure" sample.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
echo "I:check handling of cname + other data / 1"
$DIG +tcp cname1.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
@@ -71,6 +98,16 @@ grep "status: NOERROR" dig.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ -x ${SAMPLE} ] ; then
echo "I:checking answer IPv4 address filtering using dns_client (accept)"
ret=0
${SAMPLE} -p 5300 -t a 10.53.0.1 www.example.org > sample.out || ret=1
grep "www.example.org..*.192.0.2.1" sample.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
echo "I:checking answer IPv6 address filtering (accept)"
ret=0
$DIG +tcp www.example.org @10.53.0.1 aaaa -p 5300 > dig.out || ret=1
@@ -78,6 +115,15 @@ grep "status: NOERROR" dig.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ -x ${SAMPLE} ] ; then
echo "I:checking answer IPv6 address filtering using dns_client (accept)"
ret=0
${SAMPLE} -p 5300 -t aaaa 10.53.0.1 www.example.org > sample.out || ret=1
grep "www.example.org..*.2001:db8:beef::1" sample.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
echo "I:checking CNAME target filtering (deny)"
ret=0
$DIG +tcp badcname.example.net @10.53.0.1 a -p 5300 > dig.out || ret=1
@@ -92,6 +138,16 @@ grep "status: NOERROR" dig.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ -x ${SAMPLE} ] ; then
echo "I:checking CNAME target filtering using dns_client (accept)"
ret=0
${SAMPLE} -p 5300 -t a 10.53.0.1 goodcname.example.net > sample.out || ret=1
grep "goodcname.example.net..*.goodcname.example.org." sample.out > /dev/null || ret=1
grep "goodcname.example.org..*.192.0.2.1" sample.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
echo "I:checking CNAME target filtering (accept due to subdomain)"
ret=0
$DIG +tcp cname.sub.example.org @10.53.0.1 a -p 5300 > dig.out || ret=1
@@ -99,6 +155,16 @@ grep "status: NOERROR" dig.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ -x ${SAMPLE} ] ; then
echo "I:checking CNAME target filtering using dns_client (accept due to subdomain)"
ret=0
${SAMPLE} -p 5300 -t a 10.53.0.1 cname.sub.example.org > sample.out || ret=1
grep "cname.sub.example.org..*.ok.sub.example.org." sample.out > /dev/null || ret=1
grep "ok.sub.example.org..*.192.0.2.1" sample.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
echo "I:checking DNAME target filtering (deny)"
ret=0
$DIG +tcp foo.baddname.example.net @10.53.0.1 a -p 5300 > dig.out || ret=1
@@ -113,6 +179,16 @@ grep "status: NOERROR" dig.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ -x ${SAMPLE} ] ; then
echo "I:checking DNAME target filtering using dns_client (accept)"
ret=0
${SAMPLE} -p 5300 -t a 10.53.0.1 foo.gooddname.example.net > sample.out || ret=1
grep "foo.gooddname.example.net..*.gooddname.example.org" sample.out > /dev/null || ret=1
grep "foo.gooddname.example.org..*.192.0.2.1" sample.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
echo "I:checking DNAME target filtering (accept due to subdomain)"
ret=0
$DIG +tcp www.dname.sub.example.org @10.53.0.1 a -p 5300 > dig.out || ret=1
@@ -120,6 +196,16 @@ grep "status: NOERROR" dig.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ -x ${SAMPLE} ] ; then
echo "I:checking DNAME target filtering using dns_client (accept due to subdomain)"
ret=0
${SAMPLE} -p 5300 -t a 10.53.0.1 www.dname.sub.example.org > sample.out || ret=1
grep "www.dname.sub.example.org..*.ok.sub.example.org." sample.out > /dev/null || ret=1
grep "www.ok.sub.example.org..*.192.0.2.1" sample.out > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
fi
n=`expr $n + 1`
echo "I: RT21594 regression test check setup ($n)"
ret=0