rm -f dig.out.*
DIGOPTS="+tcp +noadd +nosea +nostat +nocmd +dnssec -p 5300"
+SAMPLEKEY=`cat ns1/sample.key`
# convert private-type records to readable form
showprivate () {
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking postive validation NSEC using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.example > sample.out$n || ret=1
+ grep "a.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
+ grep "a.example..*.RRSIG.A 3 2 300 .*" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking positive validation NSEC3 ($n)"
ret=0
$DIG $DIGOPTS +noauth a.nsec3.example. \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking positive validation NSEC3 using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.nsec3.example > sample.out$n || ret=1
+ grep "a.nsec3.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
+ grep "a.nsec3.example..*RRSIG.A 7 3 300.*" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking positive validation OPTOUT ($n)"
ret=0
$DIG $DIGOPTS +noauth a.optout.example. \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking positive validation OPTOUT using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.optout.example > sample.out$n || ret=1
+ grep "a.optout.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
+ grep "a.optout.example..*RRSIG.A 7 3 300.*" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking positive wildcard validation NSEC ($n)"
ret=0
$DIG $DIGOPTS a.wild.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking positive wildcard validation NSEC using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.wild.example > sample.out$n || ret=1
+ grep "a.wild.example..*10.0.0.27" sample.out$n > /dev/null || ret=1
+ grep "a.wild.example..*RRSIG.A 3 2 300.*" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking positive wildcard answer NSEC3 ($n)"
ret=0
$DIG $DIGOPTS a.wild.nsec3.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
echo "I:checking positive wildcard answer NSEC3 ($n)"
ret=0
-$DIG $DIGOPTS a.wild.nsec3.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
-grep "AUTHORITY: 4," dig.out.ns3.test$n > /dev/null || ret=1
-grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ret=1
+$DIG $DIGOPTS a.wild.nsec3.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
+grep "AUTHORITY: 4," dig.out.ns4.test$n > /dev/null || ret=1
+grep "status: NOERROR" dig.out.ns4.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking positive wildcard validation NSEC3 using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.wild.nsec3.example > sample.out$n || ret=1
+ grep "a.wild.nsec3.example..*10.0.0.6" sample.out$n > /dev/null || ret=1
+ grep "a.wild.nsec3.example..*RRSIG.A 7 3 300.*" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking positive wildcard validation OPTOUT ($n)"
ret=0
$DIG $DIGOPTS a.wild.optout.example. \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking positive wildcard validation OPTOUT using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.wild.optout.example > sample.out$n || ret=1
+ grep "a.wild.optout.example..*10.0.0.6" sample.out$n > /dev/null || ret=1
+ grep "a.wild.optout.example..*RRSIG.A 7 3 300.*" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking negative validation NXDOMAIN NSEC ($n)"
ret=0
$DIG $DIGOPTS +noauth q.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking negative validation NXDOMAIN NSEC using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking negative validation NXDOMAIN NSEC3 ($n)"
ret=0
$DIG $DIGOPTS +noauth q.nsec3.example. \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking negative validation NXDOMAIN NSEC3 using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.nsec3.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking negative validation NXDOMAIN OPTOUT ($n)"
ret=0
$DIG $DIGOPTS +noauth q.optout.example. \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking negative validation NXDOMAIN OPTOUT using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.optout.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking negative validation NODATA NSEC ($n)"
ret=0
$DIG $DIGOPTS +noauth a.example. @10.53.0.2 txt > dig.out.ns2.test$n || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking negative validation NODATA OPTOUT using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 a.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking negative validation NODATA NSEC3 ($n)"
ret=0
$DIG $DIGOPTS +noauth a.nsec3.example. \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking negative validation NODATA NSEC3 using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 a.nsec3.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking negative validation NODATA OPTOUT ($n)"
ret=0
$DIG $DIGOPTS +noauth a.optout.example. \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking negative validation NODATA OPTOUT using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 a.optout.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking negative wildcard validation NSEC ($n)"
ret=0
$DIG $DIGOPTS b.wild.example. @10.53.0.2 txt > dig.out.ns2.test$n || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking negative wildcard validation NSEC using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 b.wild.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking negative wildcard validation NSEC3 ($n)"
ret=0
$DIG $DIGOPTS b.wild.nsec3.example. @10.53.0.3 txt > dig.out.ns3.test$n || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking negative wildcard validation NSEC3 using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 b.wild.nsec3.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking negative wildcard validation OPTOUT ($n)"
ret=0
$DIG $DIGOPTS b.wild.optout.example. \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking negative wildcard validation OPTOUT using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t txt 10.53.0.4 b.optout.nsec3.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxrrset" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
# Check the insecure.example domain
echo "I:checking 1-server insecurity proof NSEC ($n)"
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking 1-server insecurity proof NSEC using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.insecure.example > sample.out$n || ret=1
+ grep "a.insecure.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking 1-server insecurity proof NSEC3 ($n)"
ret=0
$DIG $DIGOPTS +noauth a.insecure.nsec3.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking 1-server insecurity proof NSEC3 using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.insecure.nsec3.example > sample.out$n || ret=1
+ grep "a.insecure.nsec3.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking 1-server insecurity proof OPTOUT ($n)"
ret=0
$DIG $DIGOPTS +noauth a.insecure.optout.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking 1-server insecurity proof OPTOUT using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.insecure.optout.example > sample.out$n || ret=1
+ grep "a.insecure.optout.example..*10.0.0.1" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking 1-server negative insecurity proof NSEC ($n)"
ret=0
$DIG $DIGOPTS q.insecure.example. a @10.53.0.3 \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking 1-server negative insecurity proof NSEC using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.insecure.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking 1-server negative insecurity proof NSEC3 ($n)"
ret=0
$DIG $DIGOPTS q.insecure.nsec3.example. a @10.53.0.3 \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking 1-server negative insecurity proof NSEC3 using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.insecure.nsec3.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking 1-server negative insecurity proof OPTOUT ($n)"
ret=0
$DIG $DIGOPTS q.insecure.optout.example. a @10.53.0.3 \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking 1-server negative insecurity proof OPTOUT using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 q.insecure.optout.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: ncache nxdomain" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:checking 1-server negative insecurity proof with SOA hack NSEC ($n)"
ret=0
$DIG $DIGOPTS r.insecure.example. soa @10.53.0.3 \
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking failed validation using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.bogus.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: no valid RRSIG" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
# Try validating with a bad trusted key.
# This should fail.
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+if [ -e ${SAMPLE} ] ; then
+ ret=0
+ echo "I:checking that validation fails when key record is missing using dns_client ($n)"
+ $SAMPLE $SAMPLEKEY -p 5300 -t a 10.53.0.4 a.b.keyless.example > /dev/null 2> sample.out$n || ret=1
+ grep "resolution failed: broken trust chain" sample.out$n > /dev/null || ret=1
+ n=`expr $n + 1`
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+fi
+
echo "I:Checking that a bad CNAME signature is caught after a +CD query ($n)"
ret=0
#prime
ret=0
$DIG +tcp +dnssec -p 5300 +noadd +noauth soa upper.example @10.53.0.4 \
> dig.out.ns4.test$n 2>&1
-grep 'flags:.* ad;' dig.out.ns4.test$n >/dev/null || ret=1
+grep 'flags:.* ad;' dig.out.ns4.test$n > /dev/null || ret=1
grep 'RRSIG.*SOA.* UPPER\.EXAMPLE\. ' dig.out.ns4.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
ret=0
$DIG +tcp +dnssec -p 5300 +noadd +noauth soa LOWER.EXAMPLE @10.53.0.4 \
> dig.out.ns4.test$n 2>&1
-grep 'flags:.* ad;' dig.out.ns4.test$n >/dev/null || ret=1
+grep 'flags:.* ad;' dig.out.ns4.test$n > /dev/null || ret=1
grep 'RRSIG.*SOA.* lower\.example\. ' dig.out.ns4.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
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
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
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
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
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
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
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