tests.sh revision bf8267aa453e5d2a735ed732a043b77a0b355b20
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk#!/bin/sh
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk#
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# Copyright (C) 2000, 2001 Internet Software Consortium.
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk#
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# Permission to use, copy, modify, and/or distribute this software for any
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# purpose with or without fee is hereby granted, provided that the above
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# copyright notice and this permission notice appear in all copies.
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk#
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# PERFORMANCE OF THIS SOFTWARE.
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk# $Id: tests.sh,v 1.7 2007/06/19 23:47:04 tbox Exp $
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenkSYSTEMTESTTOP=..
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk. $SYSTEMTESTTOP/conf.sh
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenkstatus=0
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
73308f54e60e4cdb893e8b02955497e8f45b5893jeff.schenk @10.53.0.2 a -p 5300 > dig.out.ns2 || status=1
fb98811412f1a61efdc30b38091bf4708148a806Allan Fostergrep ";" dig.out.ns2
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster @10.53.0.3 a -p 5300 > dig.out.ns3 || status=1
6e153e9671eb382c49354ab856404a71477cce58jeff.schenkgrep ";" dig.out.ns3
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster @10.53.0.4 a -p 5300 > dig.out.ns4 || status=1
fb98811412f1a61efdc30b38091bf4708148a806Allan Fostergrep ";" dig.out.ns4
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster$PERL ../digcomp.pl dig.out.ns2 dig.out.ns3 || status=1
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster$PERL ../digcomp.pl dig.out.ns2 dig.out.ns4 || status=1
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster
fb98811412f1a61efdc30b38091bf4708148a806Allan Fosterrm -f ns2/example.db
fb98811412f1a61efdc30b38091bf4708148a806Allan Fostercp -f ns2/example2.db ns2/example.db
fb98811412f1a61efdc30b38091bf4708148a806Allan Fostersleep 6
fb98811412f1a61efdc30b38091bf4708148a806Allan Fosterkill -HUP `cat ns2/named.pid`
fb98811412f1a61efdc30b38091bf4708148a806Allan Fostersleep 60
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster @10.53.0.2 a -p 5300 > dig.out.ns2 || status=1
fb98811412f1a61efdc30b38091bf4708148a806Allan Fostergrep ";" dig.out.ns2
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster @10.53.0.3 a -p 5300 > dig.out.ns3 || status=1
fb98811412f1a61efdc30b38091bf4708148a806Allan Fostergrep ";" dig.out.ns3
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster @10.53.0.4 a -p 5300 > dig.out.ns4 || status=1
fb98811412f1a61efdc30b38091bf4708148a806Allan Fostergrep ";" dig.out.ns4
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster$PERL ../digcomp.pl dig.out.ns2 dig.out.ns3 || status=1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk$PERL ../digcomp.pl dig.out.ns2 dig.out.ns4 || status=1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkecho "I:exit status: $status"
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkexit $status
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkkill -TERM `cat ns3/named.pid` > /dev/null 2>&1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkif [ $? != 0 ]; then
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk echo "I:ns3 died before a SIGTERM was sent"
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk status=1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk rm -f ns3/named.pid
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkfi
6e153e9671eb382c49354ab856404a71477cce58jeff.schenkrm -f ns2/example.db
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkcp -f ns2/example3.db ns2/example.db
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenksleep 6
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkif [ -f ns3/named.pid ]; then
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk echo "I:ns3 didn't die when sent a SIGTERM"
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk kill -KILL `cat ns3/named.pid` > /dev/null 2>&1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk if [ $? != 0 ]; then
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk echo "I:ns3 died before a SIGKILL was sent"
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk status=1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk rm -f ns3/named.pid
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk fi
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk status=1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkfi
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkkill -HUP `cat ns2/named.pid`
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk(cd ns3 ; $NAMED -c named.conf -d 99 -g >> named.run 2>&1 & )
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenksleep 60
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk @10.53.0.2 a -p 5300 > dig.out.ns2 || status=1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkgrep ";" dig.out.ns2
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk @10.53.0.3 a -p 5300 > dig.out.ns3 || status=1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkgrep ";" dig.out.ns3
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk$PERL ../digcomp.pl dig.out.ns2 dig.out.ns3 || status=1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkrm -f ns2/example.db
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkkill -TERM `cat ns2/named.pid` > /dev/null 2>&1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkif [ $? != 0 ]; then
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk echo "I:ns2 died before a SIGTERM was sent"
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk status=1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk rm -f ns2/named.pid
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenkfi
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenksleep 6
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk
6e153e9671eb382c49354ab856404a71477cce58jeff.schenkif [ -f ns2/named.pid ]; then
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk echo "I:ns2 didn't die when sent a SIGTERM"
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk kill -KILL `cat ns2/named.pid` > /dev/null 2>&1
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk if [ $? != 0 ]; then
4c0f084e476c05989eb702c500a763ef09ba044ejeff.schenk echo "I:ns2 died before a SIGKILL was sent"
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster status=1
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster rm -f ns2/named.pid
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster fi
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster status=1
fb98811412f1a61efdc30b38091bf4708148a806Allan Fosterfi
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster
fb98811412f1a61efdc30b38091bf4708148a806Allan Fostercp -f ns2/example4.db ns2/example.db
fb98811412f1a61efdc30b38091bf4708148a806Allan Fostersleep 6
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster(cd ns2 ; $NAMED -c named.conf -d 99 -g >> named.run 2>&1 & )
6e153e9671eb382c49354ab856404a71477cce58jeff.schenksleep 60
6e153e9671eb382c49354ab856404a71477cce58jeff.schenk
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
6e153e9671eb382c49354ab856404a71477cce58jeff.schenk @10.53.0.2 a -p 5300 > dig.out.ns2 || status=1
6e153e9671eb382c49354ab856404a71477cce58jeff.schenkgrep ";" dig.out.ns2
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster @10.53.0.3 a -p 5300 > dig.out.ns3 || status=1
6e153e9671eb382c49354ab856404a71477cce58jeff.schenkgrep ";" dig.out.ns3
6e153e9671eb382c49354ab856404a71477cce58jeff.schenk
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster$PERL ../digcomp.pl dig.out.ns2 dig.out.ns3 || status=1
6e153e9671eb382c49354ab856404a71477cce58jeff.schenk
6e153e9671eb382c49354ab856404a71477cce58jeff.schenkecho "I:exit status: $status"
fb98811412f1a61efdc30b38091bf4708148a806Allan Fosterexit $status
fb98811412f1a61efdc30b38091bf4708148a806Allan Foster