tests.sh 1.17 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
. ../conf.sh
13

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

17 18 19 20
status=0
n=0

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

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

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

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

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