diff --git a/bin/tests/Makefile.in b/bin/tests/Makefile.in index b0995de60b..a06bca74bf 100644 --- a/bin/tests/Makefile.in +++ b/bin/tests/Makefile.in @@ -37,7 +37,7 @@ LWRESDEPLIBS = ../../lib/lwres/liblwres.@A@ LIBS = @LIBS@ -SUBDIRS = db dst master mem names rbt sockaddr tasks timers +SUBDIRS = db dst master mem names rbt sockaddr tasks timers system # Alphabetically TARGETS = diff --git a/bin/tests/system/ifconfig.sh b/bin/tests/system/ifconfig.sh index cc24a32987..dd6f693d4a 100644 --- a/bin/tests/system/ifconfig.sh +++ b/bin/tests/system/ifconfig.sh @@ -19,6 +19,12 @@ # Set up interface aliases for bind9 system tests. # +whoami=`whoami` +if [ $whoami != "root" ]; then + echo "Ifconfig setup must be run as root." + exit +fi + sys=`../../../config.guess` case "$1" in @@ -55,6 +61,7 @@ case "$1" in echo "Don't know how to set up interface. Giving up." exit 1 esac + touch /var/run/system_test_ifsetup done ;; @@ -90,6 +97,7 @@ case "$1" in echo "Don't know how to destroy interface. Giving up." exit 1 esac + rm -f /var/run/system_test_ifsetup done ;; diff --git a/bin/tests/system/notify/ns1/named.conf b/bin/tests/system/notify/ns1/named.conf index 60e7681398..14175e2d8d 100644 --- a/bin/tests/system/notify/ns1/named.conf +++ b/bin/tests/system/notify/ns1/named.conf @@ -1,4 +1,5 @@ options { + port 5300; directory "."; pid-file "named.pid"; listen-on { 10.53.0.1; }; diff --git a/bin/tests/system/notify/ns2/named.conf b/bin/tests/system/notify/ns2/named.conf index 57402f61eb..33ac3ca44c 100644 --- a/bin/tests/system/notify/ns2/named.conf +++ b/bin/tests/system/notify/ns2/named.conf @@ -1,4 +1,5 @@ options { + port 5300; pid-file "named.pid"; listen-on { 10.53.0.2; }; recursion no; diff --git a/bin/tests/system/notify/ns3/named.conf b/bin/tests/system/notify/ns3/named.conf index bbf30f0fc6..7ae00830af 100644 --- a/bin/tests/system/notify/ns3/named.conf +++ b/bin/tests/system/notify/ns3/named.conf @@ -1,4 +1,5 @@ options { + port 5300; directory "."; pid-file "named.pid"; listen-on { 10.53.0.3; }; diff --git a/bin/tests/system/notify/tests.sh b/bin/tests/system/notify/tests.sh index 76ad8cc40e..83a82d2bbf 100644 --- a/bin/tests/system/notify/tests.sh +++ b/bin/tests/system/notify/tests.sh @@ -28,12 +28,12 @@ SYSTEMTESTTOP=.. status=0 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\ - @10.53.0.2 a > dig.out.ns2 + @10.53.0.2 a -p 5300 > dig.out.ns2 status=`expr $status + $?` grep ";" dig.out.ns2 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\ - @10.53.0.3 a > dig.out.ns3 + @10.53.0.3 a -p 5300 > dig.out.ns3 status=`expr $status + $?` grep ";" dig.out.ns3 @@ -47,12 +47,12 @@ kill -HUP `cat ns2/named.pid` sleep 6 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\ - @10.53.0.2 a > dig.out.ns2 + @10.53.0.2 a -p 5300 > dig.out.ns2 status=`expr $status + $?` grep ";" dig.out.ns2 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\ - @10.53.0.3 a > dig.out.ns3 + @10.53.0.3 a -p 5300 > dig.out.ns3 status=`expr $status + $?` grep ";" dig.out.ns3 @@ -68,12 +68,12 @@ kill -HUP `cat ns2/named.pid` sleep 6 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\ - @10.53.0.2 a > dig.out.ns2 + @10.53.0.2 a -p 5300 > dig.out.ns2 status=`expr $status + $?` grep ";" dig.out.ns2 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\ - @10.53.0.3 a > dig.out.ns3 + @10.53.0.3 a -p 5300 > dig.out.ns3 status=`expr $status + $?` grep ";" dig.out.ns3 @@ -88,12 +88,12 @@ sleep 6 sleep 6 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\ - @10.53.0.2 a > dig.out.ns2 + @10.53.0.2 a -p 5300 > dig.out.ns2 status=`expr $status + $?` grep ";" dig.out.ns2 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\ - @10.53.0.3 a > dig.out.ns3 + @10.53.0.3 a -p 5300 > dig.out.ns3 status=`expr $status + $?` grep ";" dig.out.ns3 diff --git a/bin/tests/system/run.sh b/bin/tests/system/run.sh index d011db6f5d..337ace9e34 100644 --- a/bin/tests/system/run.sh +++ b/bin/tests/system/run.sh @@ -22,14 +22,6 @@ SYSTEMTESTTOP=. . $SYSTEMTESTTOP/conf.sh -whoami=`whoami` -if [ $whoami != "root" ]; then - echo "I:System tests must be run as root." - exit -fi - -sh ifconfig.sh start || exit $? - test $# -gt 0 || { echo "usage: $0 test-directory" >&2; exit 1; } test=$1 @@ -37,6 +29,9 @@ shift test -d $test || { echo "$0: $test: no such test" >&2; exit 1; } +test -f /var/run/system_test_ifsetup || { echo "Interfaces not set up." >&2 \ + ; exit 1; } + # Set up any dynamically generated test data if test -f $test/setup.sh then @@ -59,6 +54,4 @@ sh stop.sh $test # Cleanup ( cd $test ; sh clean.sh ) -sh ifconfig.sh stop - exit $status diff --git a/bin/tests/system/views/ns2/named1.conf b/bin/tests/system/views/ns2/named1.conf index c70979a719..2c6aa3d3b3 100644 --- a/bin/tests/system/views/ns2/named1.conf +++ b/bin/tests/system/views/ns2/named1.conf @@ -1,4 +1,5 @@ options { + port 5300; pid-file "named.pid"; listen-on { 10.53.0.2; }; recursion no; diff --git a/bin/tests/system/views/ns2/named2.conf b/bin/tests/system/views/ns2/named2.conf index 9c44020cfa..96ccc8d64a 100644 --- a/bin/tests/system/views/ns2/named2.conf +++ b/bin/tests/system/views/ns2/named2.conf @@ -1,4 +1,5 @@ options { + port 5300; pid-file "named.pid"; listen-on { 10.53.0.2; 10.53.0.4; }; diff --git a/bin/tests/system/views/ns3/named1.conf b/bin/tests/system/views/ns3/named1.conf index 0b1ae77128..ec7be97eb0 100644 --- a/bin/tests/system/views/ns3/named1.conf +++ b/bin/tests/system/views/ns3/named1.conf @@ -1,4 +1,5 @@ options { + port 5300; directory "."; pid-file "named.pid"; listen-on { 10.53.0.3; }; diff --git a/bin/tests/system/views/ns3/named2.conf b/bin/tests/system/views/ns3/named2.conf index b1cf377f58..80c4288e09 100644 --- a/bin/tests/system/views/ns3/named2.conf +++ b/bin/tests/system/views/ns3/named2.conf @@ -1,4 +1,5 @@ options { + port 5300; directory "."; pid-file "named.pid"; listen-on { 10.53.0.3; }; diff --git a/bin/tests/system/views/tests.sh b/bin/tests/system/views/tests.sh index e981980ccf..60b9c469c2 100644 --- a/bin/tests/system/views/tests.sh +++ b/bin/tests/system/views/tests.sh @@ -28,12 +28,12 @@ SYSTEMTESTTOP=.. status=0; ../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth\ - a.example. @10.53.0.2 any > dig.out.ns2.1 + a.example. @10.53.0.2 any -p 5300 > dig.out.ns2.1 status=`expr $status + $?` grep ";" dig.out.ns2.1 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth\ - a.example. @10.53.0.3 any > dig.out.ns3.1 + a.example. @10.53.0.3 any -p 5300 > dig.out.ns3.1 status=`expr $status + $?` grep ";" dig.out.ns3.1 @@ -46,17 +46,17 @@ kill -HUP `cat ns3/named.pid` sleep 10 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth\ - -b 10.53.0.4 a.example. @10.53.0.4 any > dig.out.ns4.2 + -b 10.53.0.4 a.example. @10.53.0.4 any -p 5300 > dig.out.ns4.2 status=`expr $status + $?` grep ";" dig.out.ns4.2 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth\ - -b 10.53.0.2 a.example. @10.53.0.2 any > dig.out.ns2.2 + -b 10.53.0.2 a.example. @10.53.0.2 any -p 5300 > dig.out.ns2.2 status=`expr $status + $?` grep ";" dig.out.ns2.2 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth\ - @10.53.0.3 a.example. any > dig.out.ns3.2 + @10.53.0.3 a.example. any -p 5300 > dig.out.ns3.2 status=`expr $status + $?` grep ";" dig.out.ns3.2 diff --git a/bin/tests/system/xfer/ns1/named.conf b/bin/tests/system/xfer/ns1/named.conf index 60e7681398..14175e2d8d 100644 --- a/bin/tests/system/xfer/ns1/named.conf +++ b/bin/tests/system/xfer/ns1/named.conf @@ -1,4 +1,5 @@ options { + port 5300; directory "."; pid-file "named.pid"; listen-on { 10.53.0.1; }; diff --git a/bin/tests/system/xfer/ns2/named.conf b/bin/tests/system/xfer/ns2/named.conf index b50587bd67..3526b2df3c 100644 --- a/bin/tests/system/xfer/ns2/named.conf +++ b/bin/tests/system/xfer/ns2/named.conf @@ -1,4 +1,5 @@ options { + port 5300; pid-file "named.pid"; listen-on { 10.53.0.2; }; query-source address 10.53.0.2 port 1995; @@ -6,6 +7,11 @@ options { notify yes; }; +key tsigzone. { + algorithm hmac-md5; + secret "1234abcd8765"; +}; + zone "." { type hint; file "root.hint"; @@ -16,3 +22,9 @@ zone "example" { file "example.db"; allow-update { any; }; }; + +zone "tsigzone" { + type master; + file "tsigzone.db"; + allow-transfer { key tsigzone.; }; +}; diff --git a/bin/tests/system/xfer/ns3/named.conf b/bin/tests/system/xfer/ns3/named.conf index 584ec03089..31380fc549 100644 --- a/bin/tests/system/xfer/ns3/named.conf +++ b/bin/tests/system/xfer/ns3/named.conf @@ -1,4 +1,5 @@ options { + port 5300; directory "."; pid-file "named.pid"; listen-on { 10.53.0.3; }; @@ -6,6 +7,11 @@ options { notify yes; }; +key tsigzone. { + algorithm hmac-md5; + secret "1234abcd8765"; +}; + zone "." { type hint; file "root.hint"; @@ -17,4 +23,15 @@ zone "example" { file "example.bk"; }; +server 10.53.0.2 { + keys { tsigzone.; }; +}; + +zone "tsigzone" { + type slave; + masters { 10.53.0.2; }; + file "tsigzone.bk"; + allow-transfer { key tsigzone.; }; +}; + diff --git a/bin/tests/system/xfer/tests.sh b/bin/tests/system/xfer/tests.sh index ff01e3fc52..626dd4f6bd 100644 --- a/bin/tests/system/xfer/tests.sh +++ b/bin/tests/system/xfer/tests.sh @@ -1,4 +1,4 @@ -#!/bin/sh +more#!/bin/sh # # Copyright (C) 2000 Internet Software Consortium. # @@ -28,12 +28,12 @@ echo "A:A test to determine online functionality of zone transfers" status=0; $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example. \ - @10.53.0.2 axfr > dig.out.ns2 + @10.53.0.2 axfr -p 5300 > dig.out.ns2 status=`expr $status + $?` grep ";" dig.out.ns2 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example. \ - @10.53.0.3 axfr > dig.out.ns3 + @10.53.0.3 axfr -p 5300 > dig.out.ns3 status=`expr $status + $?` grep ";" dig.out.ns3 @@ -43,6 +43,22 @@ status=`expr $status + $?` perl ../digcomp.pl knowngood.dig.out dig.out.ns3 status=`expr $status + $?` +status=0; +../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \ + tsigzone. @10.53.0.2 axfr -y tsigzone.:1234abcd8765 -p 5300 \ + > dig.out.ns2 +status=`expr $status + $?` +grep ";" dig.out.ns2 + +../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \ + tsigzone. @10.53.0.3 axfr -y tsigzone.:1234abcd8765 -p 5300 \ + > dig.out.ns3 +status=`expr $status + $?` +grep ";" dig.out.ns3 + +perl ../digcomp.pl dig.out.ns2 dig.out.ns3 +status=`expr $status + $?` + if [ $status != 0 ]; then echo "R:FAIL" else diff --git a/bin/tests/system/xferquota/ns1/named.conf b/bin/tests/system/xferquota/ns1/named.conf index 38843ca54f..5fffd1ee44 100644 --- a/bin/tests/system/xferquota/ns1/named.conf +++ b/bin/tests/system/xferquota/ns1/named.conf @@ -1,4 +1,5 @@ options { + port 5300; directory "."; pid-file "named.pid"; listen-on { 10.53.0.1; }; diff --git a/bin/tests/system/xferquota/ns2/named.conf b/bin/tests/system/xferquota/ns2/named.conf index 9dd92bb252..f8976bb32f 100644 --- a/bin/tests/system/xferquota/ns2/named.conf +++ b/bin/tests/system/xferquota/ns2/named.conf @@ -1,4 +1,5 @@ options { + port 5300; pid-file "named.pid"; listen-on { 10.53.0.2; }; recursion no; diff --git a/bin/tests/system/xferquota/tests.sh b/bin/tests/system/xferquota/tests.sh index b76c45d30d..cffa8fef9e 100644 --- a/bin/tests/system/xferquota/tests.sh +++ b/bin/tests/system/xferquota/tests.sh @@ -30,7 +30,7 @@ count=0 ticks=0 while [ $count != 300 ]; do if [ $ticks = 1 ]; then - echo "Changing test zone..." + echo "I: Changing test zone..." cp ns1/changing2.db ns1/changing.db kill -HUP `cat ns1/named.pid` fi @@ -47,12 +47,12 @@ done status=0; $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \ - zone000099.example. @10.53.0.1 axfr > dig.out.ns1 + zone000099.example. @10.53.0.1 axfr -p 5300 > dig.out.ns1 status=`expr $status + $?` grep ";" dig.out.ns1 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \ - zone000099.example. @10.53.0.2 axfr > dig.out.ns2 + zone000099.example. @10.53.0.2 axfr -p 5300 > dig.out.ns2 status=`expr $status + $?` grep ";" dig.out.ns2 @@ -62,12 +62,12 @@ status=`expr $status + $?` sleep 5 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \ - a.changing. @10.53.0.1 a > dig.out.ns1 + a.changing. @10.53.0.1 a -p 5300 > dig.out.ns1 status=`expr $status + $?` grep ";" dig.out.ns1 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \ - a.changing. @10.53.0.2 a > dig.out.ns2 + a.changing. @10.53.0.2 a -p 5300 > dig.out.ns2 status=`expr $status + $?` grep ";" dig.out.ns2