2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Make system test run as non-root (provided interface is set up) and add

to standard test script.
This commit is contained in:
Michael Sawyer
2000-06-08 22:41:37 +00:00
parent b00a764bc8
commit 10bc8ffed6
19 changed files with 88 additions and 32 deletions

View File

@@ -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 =

View File

@@ -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
;;

View File

@@ -1,4 +1,5 @@
options {
port 5300;
directory ".";
pid-file "named.pid";
listen-on { 10.53.0.1; };

View File

@@ -1,4 +1,5 @@
options {
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.2; };
recursion no;

View File

@@ -1,4 +1,5 @@
options {
port 5300;
directory ".";
pid-file "named.pid";
listen-on { 10.53.0.3; };

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,5 @@
options {
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.2; };
recursion no;

View File

@@ -1,4 +1,5 @@
options {
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.2;
10.53.0.4; };

View File

@@ -1,4 +1,5 @@
options {
port 5300;
directory ".";
pid-file "named.pid";
listen-on { 10.53.0.3; };

View File

@@ -1,4 +1,5 @@
options {
port 5300;
directory ".";
pid-file "named.pid";
listen-on { 10.53.0.3; };

View File

@@ -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

View File

@@ -1,4 +1,5 @@
options {
port 5300;
directory ".";
pid-file "named.pid";
listen-on { 10.53.0.1; };

View File

@@ -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.; };
};

View File

@@ -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.; };
};

View File

@@ -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

View File

@@ -1,4 +1,5 @@
options {
port 5300;
directory ".";
pid-file "named.pid";
listen-on { 10.53.0.1; };

View File

@@ -1,4 +1,5 @@
options {
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.2; };
recursion no;

View File

@@ -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