bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer#!/bin/sh
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2000, 2001, 2004, 2007, 2011-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/.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas GustafssonSYSTEMTESTTOP=..
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson. $SYSTEMTESTTOP/conf.sh
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
5b83a155564dc85c607046fba5e8a61f454cce05Andreas Gustafssonstatus=0
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsn=0
66465da5d11748a9c158596da07cb47803fa5082Andreas Gustafsson
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews#
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews# Wait up to 10 seconds for the servers to finish starting before testing.
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews#
baabfdc0d96bb6cb9ebe27f1afce072450cdb95eMark Andrewsfor i in 1 2 3 4 5 6 7 8 9 10
baabfdc0d96bb6cb9ebe27f1afce072450cdb95eMark Andrewsdo
baabfdc0d96bb6cb9ebe27f1afce072450cdb95eMark Andrews ret=0
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews $DIG +tcp example @10.53.0.2 soa -p 5300 > dig.out.ns2.test$n || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews grep "flags:.* aa[ ;]" dig.out.ns2.test$n > /dev/null || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews $DIG +tcp example @10.53.0.3 soa -p 5300 > dig.out.ns3.test$n || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews grep "flags:.* aa[ ;]" dig.out.ns3.test$n > /dev/null || ret=1
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrews nr=`grep 'x[0-9].*sending notify to' ns2/named.run | wc -l`
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrews [ $nr -eq 20 ] || ret=1
baabfdc0d96bb6cb9ebe27f1afce072450cdb95eMark Andrews [ $ret = 0 ] && break
baabfdc0d96bb6cb9ebe27f1afce072450cdb95eMark Andrews sleep 1
baabfdc0d96bb6cb9ebe27f1afce072450cdb95eMark Andrewsdone
baabfdc0d96bb6cb9ebe27f1afce072450cdb95eMark Andrews
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsn=`expr $n + 1`
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsecho "I:checking initial status ($n)"
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsret=0
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews @10.53.0.2 a -p 5300 > dig.out.ns2.test$n || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsgrep "10.0.0.1" dig.out.ns2.test$n > /dev/null || ret=1
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews @10.53.0.3 a -p 5300 > dig.out.ns3.test$n || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsgrep "10.0.0.1" dig.out.ns3.test$n > /dev/null || ret=1
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns3.test$n || ret=1
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews[ $ret = 0 ] || echo "I:failed"
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsstatus=`expr $ret + $status`
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrewsn=`expr $n + 1`
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrewsecho "I:checking startup notify rate limit ($n)"
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrewsret=0
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrewsgrep 'x[0-9].*sending notify to' ns2/named.run |
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrews sed 's/.*:\([0-9][0-9]\)\..*/\1/' | uniq -c | awk '{print $1}' > log.out
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrews# the notifies should span at least 4 seconds
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrewswc -l log.out | awk '$1 < 4 { exit(1) }' || ret=1
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrews# ... with no more than 5 in any one second
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrewsawk '$1 > 5 { exit(1) }' log.out || ret=1
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrews[ $ret = 0 ] || echo "I:failed"
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrewsstatus=`expr $ret + $status`
10c12aa5493f34920585164c5fb54a7ac9109fbdMark Andrews
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewssleep 1 # make sure filesystem time stamp is newer for reload.
5b83a155564dc85c607046fba5e8a61f454cce05Andreas Gustafssonrm -f ns2/example.db
fa7ee558e0536a94bfdb154a7c7ba298535459c4Mark Andrewscp -f ns2/example2.db ns2/example.db
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecickiif [ ! "$CYGWIN" ]; then
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki echo "I:reloading with example2 using HUP and waiting up to 45 seconds"
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $KILL -HUP `cat ns2/named.pid`
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecickielse
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki echo "I:reloading with example2 using rndc and waiting up to 45 seconds"
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecickifi
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaramantry=0
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaramanwhile test $try -lt 45
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaramando
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaraman sleep 1
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaraman grep 'notify from 10.53.0.2#[0-9][0-9]*: serial 2$' ns3/named.run > /dev/null && break
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaraman try=`expr $try + 1`
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaramandone
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrewsn=`expr $n + 1`
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrewsecho "I:checking notify message was logged ($n)"
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrewsret=0
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrewsgrep 'notify from 10.53.0.2#[0-9][0-9]*: serial 2$' ns3/named.run > /dev/null || ret=1
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrews[ $ret = 0 ] || echo "I:failed"
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrewsstatus=`expr $ret + $status`
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrews
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsn=`expr $n + 1`
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsecho "I:checking example2 loaded ($n)"
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsret=0
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews @10.53.0.2 a -p 5300 > dig.out.ns2.test$n || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsgrep "10.0.0.2" dig.out.ns2.test$n > /dev/null || ret=1
614610ba0b9550020f2b18c9b30593d8e6c9b6b5Matt Nelson
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews[ $ret = 0 ] || echo "I:failed"
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsstatus=`expr $ret + $status`
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsn=`expr $n + 1`
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsecho "I:checking example2 contents have been transferred after HUP reload ($n)"
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsret=0
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews @10.53.0.2 a -p 5300 > dig.out.ns2.test$n || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsgrep "10.0.0.2" dig.out.ns2.test$n > /dev/null || ret=1
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews @10.53.0.3 a -p 5300 > dig.out.ns3.test$n || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsgrep "10.0.0.2" dig.out.ns3.test$n > /dev/null || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns3.test$n || ret=1
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews[ $ret = 0 ] || echo "I:failed"
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsstatus=`expr $ret + $status`
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaramanecho "I:stopping master and restarting with example4 then waiting up to 45 seconds"
614610ba0b9550020f2b18c9b30593d8e6c9b6b5Matt Nelson$PERL $SYSTEMTESTTOP/stop.pl . ns2
bb915db969cf02534fa9991c635df067c715dfe4Brian Wellington
614610ba0b9550020f2b18c9b30593d8e6c9b6b5Matt Nelsonrm -f ns2/example.db
fa7ee558e0536a94bfdb154a7c7ba298535459c4Mark Andrewscp -f ns2/example4.db ns2/example.db
614610ba0b9550020f2b18c9b30593d8e6c9b6b5Matt Nelson
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews$PERL $SYSTEMTESTTOP/start.pl --noclean --restart . ns2
614610ba0b9550020f2b18c9b30593d8e6c9b6b5Matt Nelson
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaramantry=0
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaramanwhile test $try -lt 45
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaramando
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaraman sleep 1
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaraman grep 'notify from 10.53.0.2#[0-9][0-9]*: serial 4$' ns3/named.run > /dev/null && break
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaraman try=`expr $try + 1`
f9b167290a56481a75528491ced77e9ce8c6181dMukund Sivaramandone
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrewsn=`expr $n + 1`
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrewsecho "I:checking notify message was logged ($n)"
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrewsret=0
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrewsgrep 'notify from 10.53.0.2#[0-9][0-9]*: serial 4$' ns3/named.run > /dev/null || ret=1
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrews[ $ret = 0 ] || echo "I:failed"
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrewsstatus=`expr $ret + $status`
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrews
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsn=`expr $n + 1`
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsecho "I:checking example4 loaded ($n)"
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsret=0
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews @10.53.0.2 a -p 5300 > dig.out.ns2.test$n || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsgrep "10.0.0.4" dig.out.ns2.test$n > /dev/null || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews[ $ret = 0 ] || echo "I:failed"
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsstatus=`expr $ret + $status`
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsn=`expr $n + 1`
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsecho "I:checking example4 contents have been transfered after restart ($n)"
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsret=0
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews @10.53.0.2 a -p 5300 > dig.out.ns2.test$n || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsgrep "10.0.0.4" dig.out.ns2.test$n > /dev/null || ret=1
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd a.example.\
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews @10.53.0.3 a -p 5300 > dig.out.ns3.test$n || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsgrep "10.0.0.4" dig.out.ns3.test$n > /dev/null || ret=1
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns3.test$n || ret=1
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews[ $ret = 0 ] || echo "I:failed"
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrewsstatus=`expr $ret + $status`
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrewsn=`expr $n + 1`
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrewsecho "I:checking notify to alternate port with master inheritance"
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrews$NSUPDATE << EOF
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrewsserver 10.53.0.2 5300
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrewszone x21
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrewsupdate add added.x21 0 in txt "test string"
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrewssend
d040fa2f1c9c3045420ee25933b699290ab19250Mark AndrewsEOF
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrewsfor i in 1 2 3 4 5 6 7 8 9
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrewsdo
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrews $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd added.x21.\
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrews @10.53.0.4 txt -p 5301 > dig.out.ns4.test$n || ret=1
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrews grep "test string" dig.out.ns4.test$n > /dev/null && break
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrews sleep 1
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrewsdone
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrewsgrep "test string" dig.out.ns4.test$n > /dev/null || ret=1
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrews
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrews[ $ret = 0 ] || echo "I:failed"
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrewsstatus=`expr $ret + $status`
d040fa2f1c9c3045420ee25933b699290ab19250Mark Andrews
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewsn=`expr $n + 1`
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewsecho "I:checking notify to multiple views using tsig"
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewsret=0
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews$NSUPDATE << EOF
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewsserver 10.53.0.5 5300
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewszone x21
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewskey a aaaaaaaaaaaaaaaaaaaa
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewsupdate add added.x21 0 in txt "test string"
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewssend
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark AndrewsEOF
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewsfor i in 1 2 3 4 5 6 7 8 9
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewsdo
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd added.x21.\
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews -y b:bbbbbbbbbbbbbbbbbbbb @10.53.0.5 \
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews txt -p 5300 > dig.out.b.ns5.test$n || ret=1
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd added.x21.\
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews -y c:cccccccccccccccccccc @10.53.0.5 \
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews txt -p 5300 > dig.out.c.ns5.test$n || ret=1
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews grep "test string" dig.out.b.ns5.test$n > /dev/null &&
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews grep "test string" dig.out.c.ns5.test$n > /dev/null &&
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews break
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews sleep 1
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewsdone
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewsgrep "test string" dig.out.b.ns5.test$n > /dev/null || ret=1
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewsgrep "test string" dig.out.c.ns5.test$n > /dev/null || ret=1
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews[ $ret = 0 ] || echo "I:failed"
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrewsstatus=`expr $ret + $status`
f8eb4e5bfd1129d7639af5c2c768f53f0895952aMark Andrews
1e8c2e72e7d0f48ac37b9b15712e638631b3b619Brian Wellingtonecho "I:exit status: $status"
3635d8f9104e70e141a8f191a0e6c1502ceed2f3Mark Andrews[ $status -eq 0 ] || exit 1