02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer#!/bin/sh
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2000, 2001, 2004, 2007, 2012, 2016 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark 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/.
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater# $Id: tests.sh,v 1.25 2007/06/19 23:47:07 tbox Exp $
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas GustafssonSYSTEMTESTTOP=..
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson. $SYSTEMTESTTOP/conf.sh
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer#
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer# Perform tests
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer#
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyercount=0
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyerticks=0
931e154a1e597ab183b2a0cece9401f361a47f06Michael Sawyerwhile [ $count != 300 ]; do
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyer if [ $ticks = 1 ]; then
1e8c2e72e7d0f48ac37b9b15712e638631b3b619Brian Wellington echo "I:Changing test zone..."
fa7ee558e0536a94bfdb154a7c7ba298535459c4Mark Andrews cp -f ns1/changing2.db ns1/changing.db
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki if [ ! "$CYGWIN" ]; then
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $KILL -HUP `cat ns1/named.pid`
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki else
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $RDNC -c ../common/rndc.conf -s 10.53.0.1 \
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki -p 9953 reloade > /dev/null 2>&1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki fi
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyer fi
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyer sleep 1
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer ticks=`expr $ticks + 1`
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyer seconds=`expr $ticks \* 1`
931e154a1e597ab183b2a0cece9401f361a47f06Michael Sawyer if [ $ticks = 360 ]; then
6c3bd0545ac22ab1b41c9820183aca662afe07b9Brian Wellington echo "I:Took too long to load zones"
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyer exit 1
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer fi
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer count=`cat ns2/zone*.bk | grep xyzzy | wc -l`
9e411a82b2c5ff3b9b36f1f44ea35a70ab7a6760Andreas Gustafsson echo "I:Have $count zones up in $seconds seconds"
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyerdone
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer
722cac3cdcc5385ab64fa2d6c7f48ce3b9a68331Andreas Gustafssonstatus=0
722cac3cdcc5385ab64fa2d6c7f48ce3b9a68331Andreas Gustafsson
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
722cac3cdcc5385ab64fa2d6c7f48ce3b9a68331Andreas Gustafsson zone000099.example. @10.53.0.1 axfr -p 5300 > dig.out.ns1 || status=1
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyergrep ";" dig.out.ns1
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
722cac3cdcc5385ab64fa2d6c7f48ce3b9a68331Andreas Gustafsson zone000099.example. @10.53.0.2 axfr -p 5300 > dig.out.ns2 || status=1
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyergrep ";" dig.out.ns2
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer
722cac3cdcc5385ab64fa2d6c7f48ce3b9a68331Andreas Gustafsson$PERL ../digcomp.pl dig.out.ns1 dig.out.ns2 || status=1
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewssleep 15
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyer
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
722cac3cdcc5385ab64fa2d6c7f48ce3b9a68331Andreas Gustafsson a.changing. @10.53.0.1 a -p 5300 > dig.out.ns1 || status=1
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyergrep ";" dig.out.ns1
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyer
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
722cac3cdcc5385ab64fa2d6c7f48ce3b9a68331Andreas Gustafsson a.changing. @10.53.0.2 a -p 5300 > dig.out.ns2 || status=1
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyergrep ";" dig.out.ns2
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyer
722cac3cdcc5385ab64fa2d6c7f48ce3b9a68331Andreas Gustafsson$PERL ../digcomp.pl dig.out.ns1 dig.out.ns2 || status=1
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyer
1e8c2e72e7d0f48ac37b9b15712e638631b3b619Brian Wellingtonecho "I:exit status: $status"
3635d8f9104e70e141a8f191a0e6c1502ceed2f3Mark Andrews[ $status -eq 0 ] || exit 1