tests.sh 1.21 KB
Newer Older
1 2
#!/bin/sh
#
3
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
4
#
5 6 7
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 9 10
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
11 12 13 14

SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh

Evan Hunt's avatar
Evan Hunt committed
15 16 17
DIGOPTS="-p ${PORT}"
RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"

18 19 20 21
status=0
n=0

n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
22
echo_i "check that switching to automatic empty zones works ($n)"
23
ret=0
24
rndc_reload ns1 10.53.0.1
Evan Hunt's avatar
Evan Hunt committed
25 26 27

copy_setports ns1/named2.conf.in ns1/named.conf
$RNDCCMD 10.53.0.1 reload > /dev/null || ret=1
28
sleep 5
Evan Hunt's avatar
Evan Hunt committed
29 30 31

$DIG $DIGOPTS +vc version.bind txt ch @10.53.0.1 > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
32 33
status=`expr $status + $ret`

34
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
35
echo_i "check that allow-transfer { none; } works ($n)"
36
ret=0
Evan Hunt's avatar
Evan Hunt committed
37
$DIG $DIGOPTS axfr 10.in-addr.arpa @10.53.0.1 +all > dig.out.test$n || ret=1
38
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
Evan Hunt's avatar
Evan Hunt committed
39
if [ $ret != 0 ]; then echo_i "failed"; fi
40 41
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
42
echo_i "exit status: $status"
43
[ $status -eq 0 ] || exit 1