2000-05-17 22:38:50 +00:00
|
|
|
#!/bin/sh
|
2000-05-19 22:45:47 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2000 Internet Software Consortium.
|
|
|
|
#
|
|
|
|
# Permission to use, copy, modify, and distribute this software for any
|
|
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
|
|
# copyright notice and this permission notice appear in all copies.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
|
|
|
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
|
|
|
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
|
|
|
# CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
|
|
|
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
|
|
|
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
|
|
|
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
|
|
# SOFTWARE.
|
|
|
|
|
2000-07-10 23:46:50 +00:00
|
|
|
# $Id: tests.sh,v 1.20 2000/07/10 23:46:50 bwelling Exp $
|
2000-06-22 22:00:42 +00:00
|
|
|
|
2000-05-17 22:38:50 +00:00
|
|
|
#
|
|
|
|
# Perform tests
|
|
|
|
#
|
|
|
|
|
2000-06-05 19:36:44 +00:00
|
|
|
SYSTEMTESTTOP=..
|
|
|
|
. $SYSTEMTESTTOP/conf.sh
|
|
|
|
|
2000-06-05 19:07:46 +00:00
|
|
|
status=0
|
2000-07-08 00:39:17 +00:00
|
|
|
n=0
|
2000-05-17 22:38:50 +00:00
|
|
|
|
2000-05-18 22:49:29 +00:00
|
|
|
rm -f dig.out.*
|
2000-05-17 22:38:50 +00:00
|
|
|
|
2000-07-08 00:39:17 +00:00
|
|
|
DIGOPTS="+tcp +noadd +nosea +nostat +noquest +nocmd -p 5300"
|
2000-06-06 23:41:55 +00:00
|
|
|
|
2000-05-17 22:38:50 +00:00
|
|
|
# Check the example. domain
|
2000-07-10 23:46:50 +00:00
|
|
|
echo "I:checking that zone transfer worked"
|
2000-07-10 21:40:16 +00:00
|
|
|
ret=0
|
|
|
|
$DIG $DIGOPTS a.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
|
|
|
|
$DIG $DIGOPTS a.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
|
|
|
|
$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns3.test$n || ret=1
|
2000-07-08 00:39:17 +00:00
|
|
|
n=`expr $n + 1`
|
2000-07-10 21:40:16 +00:00
|
|
|
if [ $ret != 0 ]; then echo "I:failed"; fi
|
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
2000-07-10 23:46:50 +00:00
|
|
|
echo "I:checking positive validation"
|
2000-07-10 21:40:16 +00:00
|
|
|
ret=0
|
|
|
|
$DIG $DIGOPTS +noauth a.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
|
|
|
|
$DIG $DIGOPTS +noauth a.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
|
|
|
|
$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns4.test$n || ret=1
|
2000-07-08 00:39:17 +00:00
|
|
|
n=`expr $n + 1`
|
2000-07-10 21:40:16 +00:00
|
|
|
if [ $ret != 0 ]; then echo "I:failed"; fi
|
|
|
|
status=`expr $status + $ret`
|
2000-05-18 22:49:29 +00:00
|
|
|
|
|
|
|
# Check the insecure.example domain
|
|
|
|
|
2000-07-10 23:46:50 +00:00
|
|
|
echo "I:checking 1-server insecurity proof"
|
2000-07-10 21:40:16 +00:00
|
|
|
ret=0
|
|
|
|
$DIG $DIGOPTS a.insecure.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
|
|
|
|
$DIG $DIGOPTS a.insecure.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
|
|
|
|
$PERL ../digcomp.pl dig.out.ns3.test$n dig.out.ns4.test$n || ret=1
|
2000-07-08 00:39:17 +00:00
|
|
|
n=`expr $n + 1`
|
2000-07-10 21:40:16 +00:00
|
|
|
if [ $ret != 0 ]; then echo "I:failed"; fi
|
|
|
|
status=`expr $status + $ret`
|
2000-05-18 22:49:29 +00:00
|
|
|
|
|
|
|
# Check the secure.example domain
|
|
|
|
|
2000-07-10 23:46:50 +00:00
|
|
|
echo "I:checking multi-stage positive validation"
|
2000-07-10 21:40:16 +00:00
|
|
|
ret=0
|
|
|
|
$DIG $DIGOPTS a.secure.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
|
|
|
|
$DIG $DIGOPTS a.secure.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
|
|
|
|
$PERL ../digcomp.pl dig.out.ns3.test$n dig.out.ns4.test$n || ret=1
|
2000-07-08 00:39:17 +00:00
|
|
|
n=`expr $n + 1`
|
2000-07-10 21:40:16 +00:00
|
|
|
if [ $ret != 0 ]; then echo "I:failed"; fi
|
|
|
|
status=`expr $status + $ret`
|
2000-05-18 22:49:29 +00:00
|
|
|
|
|
|
|
# Check the bogus domain
|
|
|
|
|
2000-07-10 23:46:50 +00:00
|
|
|
echo "I:checking negative validation"
|
2000-07-10 21:40:16 +00:00
|
|
|
ret=0
|
|
|
|
$DIG $DIGOPTS a.bogus.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
|
|
|
|
grep "SERVFAIL" dig.out.ns4.test$n > /dev/null || ret=1
|
2000-07-08 00:39:17 +00:00
|
|
|
n=`expr $n + 1`
|
2000-07-10 21:40:16 +00:00
|
|
|
if [ $ret != 0 ]; then echo "I:failed"; fi
|
|
|
|
status=`expr $status + $ret`
|
2000-06-16 22:39:45 +00:00
|
|
|
|
2000-06-21 23:06:20 +00:00
|
|
|
# Try validating a key with a bad trusted key.
|
|
|
|
# This should fail.
|
|
|
|
|
2000-07-10 23:46:50 +00:00
|
|
|
echo "I:checking that validation fails with a misconfigured trusted key"
|
2000-07-10 21:40:16 +00:00
|
|
|
ret=0
|
|
|
|
$DIG $DIGOPTS example. key @10.53.0.5 -p 5300 > dig.out.ns5.test$n || ret=1
|
|
|
|
grep "SERVFAIL" dig.out.ns5.test$n > /dev/null || ret=1
|
2000-07-08 00:39:17 +00:00
|
|
|
n=`expr $n + 1`
|
2000-07-10 21:40:16 +00:00
|
|
|
if [ $ret != 0 ]; then echo "I:failed"; fi
|
|
|
|
status=`expr $status + $ret`
|
2000-07-08 00:39:17 +00:00
|
|
|
|
|
|
|
# Check the insecure.secure.example domain (insecurity proof)
|
|
|
|
|
2000-07-10 23:46:50 +00:00
|
|
|
echo "I:checking 2-server insecurity proof"
|
2000-07-10 21:40:16 +00:00
|
|
|
ret=0
|
2000-07-08 00:39:17 +00:00
|
|
|
$DIG $DIGOPTS a.insecure.secure.example. @10.53.0.2 a > dig.out.ns2.test$n \
|
2000-07-10 21:40:16 +00:00
|
|
|
|| ret=1
|
2000-07-08 00:39:17 +00:00
|
|
|
$DIG $DIGOPTS a.insecure.secure.example. @10.53.0.4 a > dig.out.ns4.test$n \
|
2000-07-10 21:40:16 +00:00
|
|
|
|| ret=1
|
|
|
|
$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns4.test$n || ret=1
|
2000-07-08 00:39:17 +00:00
|
|
|
n=`expr $n + 1`
|
2000-07-10 21:40:16 +00:00
|
|
|
if [ $ret != 0 ]; then echo "I:failed"; fi
|
|
|
|
status=`expr $status + $ret`
|
2000-07-08 00:39:17 +00:00
|
|
|
|
|
|
|
# Check a negative response in insecure.secure.example
|
|
|
|
|
2000-07-10 23:46:50 +00:00
|
|
|
echo "I:checking 2-server insecurity proof with a negative answer"
|
2000-07-10 21:40:16 +00:00
|
|
|
ret=0
|
2000-07-08 00:39:17 +00:00
|
|
|
$DIG $DIGOPTS q.insecure.secure.example. @10.53.0.2 a > dig.out.ns2.test$n \
|
2000-07-10 21:40:16 +00:00
|
|
|
|| ret=1
|
2000-07-08 00:39:17 +00:00
|
|
|
$DIG $DIGOPTS q.insecure.secure.example. @10.53.0.4 a > dig.out.ns4.test$n \
|
2000-07-10 21:40:16 +00:00
|
|
|
|| ret=1
|
|
|
|
$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns4.test$n || ret=1
|
2000-07-08 00:39:17 +00:00
|
|
|
n=`expr $n + 1`
|
2000-07-10 21:40:16 +00:00
|
|
|
if [ $ret != 0 ]; then echo "I:failed"; fi
|
|
|
|
status=`expr $status + $ret`
|
2000-06-21 23:06:20 +00:00
|
|
|
|
2000-07-07 18:25:20 +00:00
|
|
|
echo "I:exit status: $status"
|
2000-07-05 18:49:06 +00:00
|
|
|
exit $status
|