]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check that the server copes with responses containing a CNAME
authorAndreas Gustafsson <source@isc.org>
Fri, 28 Jul 2000 22:42:42 +0000 (22:42 +0000)
committerAndreas Gustafsson <source@isc.org>
Fri, 28 Jul 2000 22:42:42 +0000 (22:42 +0000)
and other data

bin/tests/system/resolver/ans2/ans.pl
bin/tests/system/resolver/tests.sh

index 63e880db3e233ca76863bb9c685f74e6bbeb6485..edc72828d145d16222bab9cc3411f4386d09e8ea 100644 (file)
@@ -27,12 +27,27 @@ for (;;) {
        my ($packet, $err) = new Net::DNS::Packet(\$buf, 0);
        $err and die $err;
 
-       print "REQUEST:\n";     
+       print "REQUEST:\n";
        $packet->print;
 
        $packet->header->qr(1);
-       $packet->push("authority", new Net::DNS::RR("below.www.example.com 300 NS ns.below.www.example.com"));
-       $packet->push("additional", new Net::DNS::RR("ns.below.www.example.com 300 A 10.53.0.3"));
+
+       my @questions = $packet->question;
+       my $qname = $questions[0]->qname;
+
+       if ($qname eq "cname1.example.com") {
+               # Data for the "cname + other data / 1" test
+               $packet->push("answer", new Net::DNS::RR("cname1.example.com 300 CNAME cname1.example.com"));
+               $packet->push("answer", new Net::DNS::RR("cname1.example.com 300 A 1.2.3.4"));
+       } elsif ($qname eq "cname2.example.com") {
+               # Data for the "cname + other data / 2" test: same RRs in opposite order
+               $packet->push("answer", new Net::DNS::RR("cname2.example.com 300 A 1.2.3.4"));
+               $packet->push("answer", new Net::DNS::RR("cname2.example.com 300 CNAME cname2.example.com"));
+       } else {
+               # Data for the "bogus referrals" test
+               $packet->push("authority", new Net::DNS::RR("below.www.example.com 300 NS ns.below.www.example.com"));
+               $packet->push("additional", new Net::DNS::RR("ns.below.www.example.com 300 A 10.53.0.3"));
+       }
 
        $sock->send($packet->data);
 
index 61db90e085f2b99e3f540c5d73cdbe301ef16b81..055895dfa16808c4ba31af80c045f4aea6ec7a0f 100644 (file)
 # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.3 2000/07/27 09:40:40 tale Exp $
+# $Id: tests.sh,v 1.4 2000/07/28 22:42:41 gson Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
 
-#
-# Perform tests
-#
-
 status=0
 
+echo "I:checking handling of bogus referrals"
 # If the server has the "INSIST(!external)" bug, this query will kill it.
-$DIG +tcp example. dig www.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
+$DIG +tcp www.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
+
+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
+
+echo "I:check handling of cname + other data / 2"
+$DIG +tcp cname2.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
 
-# Query once more to see if the server is still alive.
-$DIG +tcp example. dig www.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
+echo "I:check that server is still running"
+$DIG +tcp www.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
 
 echo "I:exit status: $status"
 exit $status