tests.sh revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#!/bin/sh
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# Copyright (C) 2000, 2001, 2004, 2007, 2012, 2016 Internet Systems Consortium, Inc. ("ISC")
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# This Source Code Form is subject to the terms of the Mozilla Public
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# License, v. 2.0. If a copy of the MPL was not distributed with this
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# file, You can obtain one at http://mozilla.org/MPL/2.0/.
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# $Id: tests.sh,v 1.25 2007/06/19 23:47:07 tbox Exp $
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffSYSTEMTESTTOP=..
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff. $SYSTEMTESTTOP/conf.sh
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# Perform tests
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graffcount=0
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graffticks=0
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graffwhile [ $count != 300 ]; do
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff if [ $ticks = 1 ]; then
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff echo "I:Changing test zone..."
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff cp -f ns1/changing2.db ns1/changing.db
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff kill -HUP `cat ns1/named.pid`
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff fi
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff sleep 1
a8dcebd0419f27234664e89b9cd48bc54cad08a7Michael Graff ticks=`expr $ticks + 1`
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff seconds=`expr $ticks \* 1`
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff if [ $ticks = 360 ]; then
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff echo "I:Took too long to load zones"
0b14ebe3132846e91bea02992493e3d506233e76Michael Graff exit 1
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff fi
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff count=`cat ns2/zone*.bk | grep xyzzy | wc -l`
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff echo "I:Have $count zones up in $seconds seconds"
8d1943e8ffa991d54c5406342e44d7134762e7eaMichael Graffdone
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
a8dcebd0419f27234664e89b9cd48bc54cad08a7Michael Graffstatus=0
a8dcebd0419f27234664e89b9cd48bc54cad08a7Michael Graff
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff zone000099.example. @10.53.0.1 axfr -p 5300 > dig.out.ns1 || status=1
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graffgrep ";" dig.out.ns1
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff zone000099.example. @10.53.0.2 axfr -p 5300 > dig.out.ns2 || status=1
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graffgrep ";" dig.out.ns2
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael Graff$PERL ../digcomp.pl dig.out.ns1 dig.out.ns2 || status=1
a8dcebd0419f27234664e89b9cd48bc54cad08a7Michael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graffsleep 15
a8dcebd0419f27234664e89b9cd48bc54cad08a7Michael Graff
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael Graff$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff a.changing. @10.53.0.1 a -p 5300 > dig.out.ns1 || status=1
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graffgrep ";" dig.out.ns1
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael Graff a.changing. @10.53.0.2 a -p 5300 > dig.out.ns2 || status=1
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graffgrep ";" dig.out.ns2
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael Graff$PERL ../digcomp.pl dig.out.ns1 dig.out.ns2 || status=1
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graffecho "I:exit status: $status"
d1ba6e9180c7d7458656a6e53e52fde056fd244cMichael Graff[ $status -eq 0 ] || exit 1
d1ba6e9180c7d7458656a6e53e52fde056fd244cMichael Graff