db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrews#!/bin/sh
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrews#
dce54b9b5cfa450570fe9c11644450aeb3ee89f3Tinderbox User# Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrews
db8938c993d3eaeae1d86feb1b5da511831a9014Mark AndrewsSYSTEMTESTTOP=..
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrews. $SYSTEMTESTTOP/conf.sh
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrews
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrewsstatus=0
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrewsn=0
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrews
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrewsn=`expr $n + 1`
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrewsecho "I:check that switching to automatic empty zones works ($n)"
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrewsret=0
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrews$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reload > /dev/null || ret=1
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrewssleep 5
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrewscp ns1/named2.conf ns1/named.conf
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrews$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reload > /dev/null || ret=1
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrewssleep 5
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrews$DIG +vc version.bind txt ch @10.53.0.1 -p 5300 > /dev/null || ret=1
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrewsstatus=`expr $status + $ret`
db8938c993d3eaeae1d86feb1b5da511831a9014Mark Andrews
79521569952d5e2475f05e4397dc976f4685056eMark Andrewsn=`expr $n + 1`
79521569952d5e2475f05e4397dc976f4685056eMark Andrewsecho "I:check that allow-transfer { none; } works ($n)"
79521569952d5e2475f05e4397dc976f4685056eMark Andrewsret=0
79521569952d5e2475f05e4397dc976f4685056eMark Andrews$DIG axfr 10.in-addr.arpa @10.53.0.1 -p 5300 +all > dig.out.test$n || ret=1
79521569952d5e2475f05e4397dc976f4685056eMark Andrewsgrep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
79521569952d5e2475f05e4397dc976f4685056eMark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
79521569952d5e2475f05e4397dc976f4685056eMark Andrewsstatus=`expr $status + $ret`
79521569952d5e2475f05e4397dc976f4685056eMark Andrews
3635d8f9104e70e141a8f191a0e6c1502ceed2f3Mark Andrewsecho "I:exit status: $status"
3635d8f9104e70e141a8f191a0e6c1502ceed2f3Mark Andrews[ $status -eq 0 ] || exit 1