Commit a92428ec authored by Michael Sawyer's avatar Michael Sawyer

Sweeping changes to system test suite

parent e6ce1a0e
......@@ -9,7 +9,7 @@ NAMED=$TOP/bin/named/named
KEYGEN=$TOP/bin/dnssec/dnssec-keygen
SIGNER=$TOP/bin/dnssec/dnssec-signzone
KEYSIGNER=$TOP/bin/dnssec/dnssec-signkey
KEYSETTOOL=$TOP/bin/tests/dnssec-makekeyset
KEYSETTOOL=$TOP/bin/dnssec/dnssec-makekeyset
SUBDIRS="xfer dnssec xferquota"
......
......@@ -44,7 +44,7 @@ while (<FILE1>) {
}
if ($entry{"$name ; $class.$type ; $value"} ne "") {
$line = $entry{"$name ; $class.$type ; $value"};
print ("Duplicate entry:\n> $_\n< $line\n");
print ("Duplicate entry in $file1:\n> $_\n< $line\n");
} else {
$entry{"$name ; $class.$type ; $value"} = $_;
}
......
//NS1
options {
directory ".";
pid-file "named.pid";
......@@ -8,5 +10,7 @@ options {
zone "." {
type master;
file "root.db";
file "root.db.signed";
};
include "trusted.conf";
// NS2
options {
pid-file "named.pid";
listen-on { 10.53.0.2; };
......
// NS3
options {
pid-file "named.pid";
listen-on { 10.53.0.3; };
......@@ -12,6 +14,7 @@ zone "." {
zone "example" {
type slave;
masters { 10.53.0.2; };
file "example.bk";
};
......
// NS4
options {
directory ".";
pid-file "named.pid";
......
......@@ -2,4 +2,4 @@
cd ns1 && sh sign.sh
#echo "a.bogus.example. A 10.0.0.22" >>../ns3/secure.example.db.signed
echo "a.bogus.example. A 10.0.0.22" >>../ns3/bogus.example.db.signed
......@@ -30,8 +30,7 @@ grep ";" dig.out.ns3
status=`expr $status + $?`
grep ";" dig.out.ns4
perl ../digcomp.pl dig.out.ns2 dig.out.ns3
perl ../digcomp.pl dig.out.ns2 dig.out.ns4
rm -f dig.out.*
# Check the example. domain
../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
......@@ -44,10 +43,70 @@ grep ";" dig.out.ns2
status=`expr $status + $?`
grep ";" dig.out.ns3
../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
perl ../digcomp.pl dig.out.ns2 dig.out.ns3
status=`expr $status + $?`
rm -f dig.out.*
../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth \
a.example. @10.53.0.2 a > dig.out.ns2
status=`expr $status + $?`
grep ";" dig.out.ns2
../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth \
a.example. @10.53.0.4 a > dig.out.ns4
status=`expr $status + $?`
grep ";" dig.out.ns4
grep ";" dig.out.ns2
perl ../digcomp.pl dig.out.ns2 dig.out.ns3
perl ../digcomp.pl dig.out.ns2 dig.out.ns4
status=`expr $status + $?`
# Check the insecure.example domain
rm -f dig.out.*
../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
a.insecure.example. @10.53.0.3 a > dig.out.ns3
status=`expr $status + $?`
grep ";" dig.out.ns3
../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
a.insecure.example. @10.53.0.4 a > dig.out.ns4
status=`expr $status + $?`
grep ";" dig.out.ns4
perl ../digcomp.pl dig.out.ns3 dig.out.ns4
status=`expr $status + $?`
# Check the secure.example domain
rm -f dig.out.*
../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
a.secure.example. @10.53.0.3 a > dig.out.ns3
status=`expr $status + $?`
grep ";" dig.out.ns3
../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
a.secure.example. @10.53.0.4 a > dig.out.ns4
status=`expr $status + $?`
grep ";" dig.out.ns4
perl ../digcomp.pl dig.out.ns3 dig.out.ns4
status=`expr $status + $?`
# Check the bogus domain
rm -f dig.out.*
../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocmd \
a.bogus.example. @10.53.0.4 a > dig.out.ns4
grep "SERVFAIL" dig.out.ns4 > /dev/null
status=`expr $status + $?`
echo "SERVFAIL is expected in the following:"
grep ";" dig.out.ns4
if [ $status != 0 ]; then
echo "FAILED with status $status"
fi
......@@ -4,33 +4,76 @@
#
sys=`../../../config.guess`
case "$sys" in
sparc-sun-solaris2.[6-8])
type="lo0"
case "$1" in
'start')
for ns in 1 2 3 4
do
case "$sys" in
sparc-sun-solaris2.[6-8])
ifconfig lo0:$ns 10.53.0.$ns up
;;
*-pc-linux-gnu)
ifconfig lo:$ns 10.53.0.$ns up
;;
*-unknown-freebsdelf3.4)
ifconfig lo0 10.53.0.$ns alias
;;
*-unknown-netbsd*)
ifconfig lo0 10.53.0.$ns alias
;;
*-pc-bsdi3.*)
ifconfig lo0 add 10.53.0.$ns
;;
*-dec-osf5.*)
ifconfig lo0 alias 10.53.0.$ns
;;
*-dec-osf4.*)
ifconfig lo0 alias 10.53.0.$ns
;;
*-pc-bsdi4.*)
ifconfig lo0 add 10.53.0.$ns
;;
*)
echo "Don't know how to set up interface. Giving up."
exit 1
esac
done
;;
i686-pc-linux-gnu)
type="lo"
;;
i386-unknown-freebsdelf3.4|*-unknown-netbsd*)
type="alias"
'stop')
for ns in 4 3 2 1
do
case "$sys" in
sparc-sun-solaris2.[6-8])
ifconfig lo0:$ns 10.53.0.$ns down
;;
*-pc-linux-gnu)
ifconfig lo:$ns 10.53.0.$ns down
;;
*-unknown-freebsdelf3.4)
ifconfig lo0 10.53.0.$ns delete
;;
*-unknown-netbsd*)
ifconfig lo0 10.53.0.$ns delete
;;
*-pc-bsdi3.*)
ifconfig lo0 remove 10.53.0.$ns
;;
*-dec-osf5.*)
ifconfig lo0 -alias 10.53.0.$ns
;;
*-dec-osf4.*)
ifconfig lo0 -alias 10.53.0.$ns
;;
*-pc-bsdi4.*)
ifconfig lo0 remove 10.53.0.$ns
;;
*)
echo "Don't know how to destroy interface. Giving up."
exit 1
esac
done
;;
esac
for ns in 1 2 3 4
do
case "$type" in
lo0)
ifconfig lo0:$ns 10.53.0.$ns up
;;
lo)
ifconfig lo:$ns 10.53.0.$ns up
;;
alias)
ifconfig lo0 10.53.0.$ns alias
;;
*)
echo "Don't know how to set up interface. Giving up."
exit 1
esac
done
......@@ -4,6 +4,12 @@
#
. ./conf.sh
sh ifconfig.sh start
if [ $? != 0 ]; then
exit 0
fi
test $# -gt 0 || { echo "usage: runtest.sh test-directory" >&2; exit 1; }
test=$1
......@@ -20,10 +26,19 @@ fi
# Start name servers running
sh start.sh $test
sleep 10
# Run the tests
( cd $test ; sh tests.sh )
echo "Result code $?"
status=$_
# Shutdown
sh stop.sh $test
# Cleanup
( cd $test ; sh clean.sh )
sh ifconfig.sh stop
exit $status
#!/bin/sh
#
# Run a system test.
#
. ./conf.sh
test $# -gt 0 || { echo "usage: runtest.sh test-directory" >&2; exit 1; }
test=$1
shift
test -d $test || { echo "$0: $test: no such test" >&2; exit 1; }
# Set up any dynamically generated test data
if test -f $test/setup.sh
then
( cd $test && sh setup.sh "$@" )
fi
......@@ -12,3 +12,13 @@ do
kill -TERM `cat $pidfile`
fi
done
sleep 5
for d in ns*
do
pidfile="$d/named.pid"
if [ -f $pidfile ]; then
kill -KILL `cat $pidfile`
fi
done
......@@ -27,3 +27,9 @@ status=`expr $status + $?`
perl ../digcomp.pl knowngood.dig.out dig.out.ns3
status=`expr $status + $?`
if [ $status != 0 ]; then
echo "FAILED with status $status"
fi
exit $status
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment