tests.sh revision 15a44745412679c30a6d022733925af70a38b715
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews#!/bin/sh
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews#
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# Copyright (C) 2000 Internet Software Consortium.
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews#
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# Permission to use, copy, modify, and distribute this software for any
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# purpose with or without fee is hereby granted, provided that the above
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# copyright notice and this permission notice appear in all copies.
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews#
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# $Id: tests.sh,v 1.18 2000/07/27 09:41:28 tale Exp $
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark AndrewsSYSTEMTESTTOP=..
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews. $SYSTEMTESTTOP/conf.sh
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews#
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews# Perform tests
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews#
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrewscount=0
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrewsticks=0
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrewswhile [ $count != 300 ]; do
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews if [ $ticks = 1 ]; then
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews echo "I:Changing test zone..."
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews cp ns1/changing2.db ns1/changing.db
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews kill -HUP `cat ns1/named.pid`
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews fi
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews sleep 1
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews ticks=`expr $ticks + 1`
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews seconds=`expr $ticks \* 1`
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews if [ $ticks = 360 ]; then
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews echo "I:Took too long to load zones"
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews exit 1
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews fi
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews count=`cat ns2/zone*.bk | grep xyzzy | wc -l`
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews echo "I:Have $count zones up in $seconds seconds"
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrewsdone
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrewsstatus=0
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews zone000099.example. @10.53.0.1 axfr -p 5300 > dig.out.ns1 || status=1
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrewsgrep ";" dig.out.ns1
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews zone000099.example. @10.53.0.2 axfr -p 5300 > dig.out.ns2 || status=1
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrewsgrep ";" dig.out.ns2
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews$PERL ../digcomp.pl dig.out.ns1 dig.out.ns2 || status=1
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrewssleep 5
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrews a.changing. @10.53.0.1 a -p 5300 > dig.out.ns1 || status=1
2fb6d3782b548ba678cfb8ff09e0d1e49fafb84dMark Andrewsgrep ";" dig.out.ns1
$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
a.changing. @10.53.0.2 a -p 5300 > dig.out.ns2 || status=1
grep ";" dig.out.ns2
$PERL ../digcomp.pl dig.out.ns1 dig.out.ns2 || status=1
echo "I:exit status: $status"
exit $status