1#!/bin/sh 2# 3# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") 4# Copyright (C) 2000, 2001 Internet Software Consortium. 5# 6# Permission to use, copy, modify, and/or distribute this software for any 7# purpose with or without fee is hereby granted, provided that the above 8# copyright notice and this permission notice appear in all copies. 9# 10# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 11# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 12# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 13# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 14# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 15# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16# PERFORMANCE OF THIS SOFTWARE. 17 18# $Id: tests.sh,v 1.30 2007/06/19 23:47:06 tbox Exp $ 19 20SYSTEMTESTTOP=.. 21. $SYSTEMTESTTOP/conf.sh 22 23status=0 24 25echo "I:fetching a.example from ns2's initial configuration" 26$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth \ 27 a.example. @10.53.0.2 any -p 5300 > dig.out.ns2.1 || status=1 28grep ";" dig.out.ns2.1 # XXXDCL why is this here? 29 30echo "I:fetching a.example from ns3's initial configuration" 31$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth \ 32 a.example. @10.53.0.3 any -p 5300 > dig.out.ns3.1 || status=1 33grep ";" dig.out.ns3.1 # XXXDCL why is this here? 34 35echo "I:copying in new configurations for ns2 and ns3" 36rm -f ns2/named.conf ns3/named.conf ns2/example.db 37cp -f ns2/named2.conf ns2/named.conf 38cp -f ns3/named2.conf ns3/named.conf 39cp -f ns2/example2.db ns2/example.db 40 41echo "I:reloading ns2 and ns3 with rndc" 42$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /' 43$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 reload 2>&1 | sed 's/^/I:ns3 /' 44 45echo "I:sleeping for 20 seconds" 46sleep 20 47 48echo "I:fetching a.example from ns2's 10.53.0.4, source address 10.53.0.4" 49$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth \ 50 -b 10.53.0.4 a.example. @10.53.0.4 any -p 5300 > dig.out.ns4.2 \ 51 || status=1 52grep ";" dig.out.ns4.2 # XXXDCL why is this here? 53 54echo "I:fetching a.example from ns2's 10.53.0.2, source address 10.53.0.2" 55$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth \ 56 -b 10.53.0.2 a.example. @10.53.0.2 any -p 5300 > dig.out.ns2.2 \ 57 || status=1 58grep ";" dig.out.ns2.2 # XXXDCL why is this here? 59 60echo "I:fetching a.example from ns3's 10.53.0.3, source address defaulted" 61$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noauth \ 62 @10.53.0.3 a.example. any -p 5300 > dig.out.ns3.2 || status=1 63grep ";" dig.out.ns3.2 # XXXDCL why is this here? 64 65echo "I:comparing ns3's initial a.example to one from reconfigured 10.53.0.2" 66$PERL ../digcomp.pl dig.out.ns3.1 dig.out.ns2.2 || status=1 67 68echo "I:comparing ns3's initial a.example to one from reconfigured 10.53.0.3" 69$PERL ../digcomp.pl dig.out.ns3.1 dig.out.ns3.2 || status=1 70 71echo "I:comparing ns2's initial a.example to one from reconfigured 10.53.0.4" 72$PERL ../digcomp.pl dig.out.ns2.1 dig.out.ns4.2 || status=1 73 74echo "I:comparing ns2's initial a.example to one from reconfigured 10.53.0.3" 75echo "I:(should be different)" 76if $PERL ../digcomp.pl dig.out.ns2.1 dig.out.ns3.2 >/dev/null 77then 78 echo "I:no differences found. something's wrong." 79 status=1 80fi 81 82echo "I:exit status: $status" 83exit $status 84