tests.sh revision b1c6de5456a5287b442de5620282902da39a4968
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence# Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Permission to use, copy, modify, and/or distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# purpose with or without fee is hereby granted, provided that the above
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff# copyright notice and this permission notice appear in all copies.
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
142784f574e0b63e8bbcccb762eb8727ac7c76feBrian Wellington# PERFORMANCE OF THIS SOFTWARE.
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff# $Id: tests.sh,v 1.4 2011/10/25 01:54:20 marka Exp $
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graffecho "I:checking that the zone is signed on initial transfer ($n)"
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff $DIG $DIGOPTS @10.53.0.3 -p 5300 bits TYPE65534 > dig.out.ns3.test$n
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ret=1
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff grep "ANSWER: 3," dig.out.ns3.test$n > /dev/null || ret=1
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff records=`grep 'TYPE65534.*05[0-9A-F][0-9A-F][0-9A-F][0-9A-F]0001$' dig.out.ns3.test$n | wc -l`
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graffecho "I:checking removal of private type record via 'rndc keydone' ($n)"
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff$DIG $DIGOPTS @10.53.0.3 -p 5300 bits TYPE65534 > dig.out.ns3.test$n
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graffrecords=`sed -n -e 's/.*TYPE65534.*\(05[0-9A-F][0-9A-F][0-9A-F][0-9A-F]0001\)$/\1/p' dig.out.ns3.test$n`
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 keydone "${record}" bits || ret=1
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff break; # We only want to remove 1 record for now.
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff $DIG $DIGOPTS @10.53.0.3 -p 5300 bits TYPE65534 > dig.out.ns3.test$n
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence grep "ANSWER: 2," dig.out.ns3.test$n > /dev/null || ans=1
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graffecho "I:checking private type was properly signed ($n)"
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff$DIG $DIGOPTS @10.53.0.6 -p 5300 bits TYPE65534 > dig.out.ns6.test$n
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graffgrep "ANSWER: 2," dig.out.ns6.test$n > /dev/null || ret=1
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graffgrep "flags:.* ad[ ;]" dig.out.ns6.test$n > /dev/null || ret=1
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graffecho "I:checking removal of remaining private type record via 'rndc keydone' ($n)"
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff$DIG $DIGOPTS @10.53.0.3 -p 5300 bits TYPE65534 > dig.out.ns3.test$n
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graffrecords=`sed -n -e 's/.*TYPE65534.*\(05[0-9A-F][0-9A-F][0-9A-F][0-9A-F]0001\)$/\1/p' dig.out.ns3.test$n`
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 keydone "${record}" bits || ret=1
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff $DIG $DIGOPTS @10.53.0.3 -p 5300 bits TYPE65534 > dig.out.ns3.test$n
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff grep "ANSWER: 0," dig.out.ns3.test$n > /dev/null || ans=1
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ans=1
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graffecho "I:checking negative private type response was properly signed ($n)"
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff$DIG $DIGOPTS @10.53.0.6 -p 5300 bits TYPE65534 > dig.out.ns6.test$n
58ff88cca7c169f7fbebc9b6e93bbba1fb345157Michael Graffgrep "status: NOERROR" dig.out.ns6.test$n > /dev/null || ret=1
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffgrep "ANSWER: 0," dig.out.ns6.test$n > /dev/null || ret=1
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffgrep "flags:.* ad[ ;]" dig.out.ns6.test$n > /dev/null || ret=1
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffserver 10.53.0.2 5300
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffupdate add added.bits 0 A 1.2.3.4
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffecho "I:checking that the record is added on the hidden master ($n)"
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff$DIG $DIGOPTS @10.53.0.2 -p 5300 added.bits A > dig.out.ns2.test$n
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffgrep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffgrep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffecho "I:checking that update has been transfered and has been signed ($n)"
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff $DIG $DIGOPTS @10.53.0.3 -p 5300 added.bits A > dig.out.ns3.test$n
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ret=1
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff grep "ANSWER: 2," dig.out.ns3.test$n > /dev/null || ret=1
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graffserver 10.53.0.2 5300
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graffupdate add bits 0 SOA ns2.bits. . 2011072400 20 20 1814400 3600
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graffecho "I:checking YYYYMMDDVV (2011072400) serial on hidden master ($n)"
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff$DIG $DIGOPTS @10.53.0.2 -p 5300 bits SOA > dig.out.ns2.test$n
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graffgrep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
4e675038a097065ff13944232cd7c89ac5961984Michael Graffgrep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
4e675038a097065ff13944232cd7c89ac5961984Michael Graffgrep "2011072400" dig.out.ns2.test$n > /dev/null || ret=1
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graffecho "I:checking YYYYMMDDVV (2011072400) serial in signed zone ($n)"
f1b68725503ff3e46001eee5a1751e29a43a09d1Andreas Gustafsson $DIG $DIGOPTS @10.53.0.3 -p 5300 bits SOA > dig.out.ns3.test$n
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ret=1
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff grep "ANSWER: 2," dig.out.ns3.test$n > /dev/null || ret=1
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff grep "2011072400" dig.out.ns3.test$n > /dev/null || ret=1
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graffecho "I:checking that the zone is signed on initial transfer, noixfr ($n)"
e24f605ad64182532640dc6721070456b13112d5Michael Grafffor i in 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff $DIG $DIGOPTS @10.53.0.3 -p 5300 noixfr TYPE65534 > dig.out.ns3.test$n
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ret=1
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff grep "ANSWER: 3," dig.out.ns3.test$n > /dev/null || ret=1
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff records=`grep "TYPE65534.*05[0-9A-F][0-9A-F][0-9A-F][0-9A-F]0001" dig.out.ns3.test$n | wc -l`
e24f605ad64182532640dc6721070456b13112d5Michael Graffserver 10.53.0.4 5300
e24f605ad64182532640dc6721070456b13112d5Michael Graffupdate add added.noixfr 0 A 1.2.3.4
e24f605ad64182532640dc6721070456b13112d5Michael Graffecho "I:checking that the record is added on the hidden master, noixfr ($n)"
e24f605ad64182532640dc6721070456b13112d5Michael Graff$DIG $DIGOPTS @10.53.0.4 -p 5300 added.noixfr A > dig.out.ns4.test$n
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graffgrep "status: NOERROR" dig.out.ns4.test$n > /dev/null || ret=1
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graffgrep "ANSWER: 1," dig.out.ns4.test$n > /dev/null || ret=1
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graffecho "I:checking that update has been transfered and has been signed, noixfr ($n)"
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Grafffor i in 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff $DIG $DIGOPTS @10.53.0.3 -p 5300 added.noixfr A > dig.out.ns3.test$n
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ret=1
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff grep "ANSWER: 2," dig.out.ns3.test$n > /dev/null || ret=1
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graffserver 10.53.0.4 5300
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graffupdate add noixfr 0 SOA ns4.noixfr. . 2011072400 20 20 1814400 3600
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graffecho "I:checking YYYYMMDDVV (2011072400) serial on hidden master, noixfr ($n)"
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff$DIG $DIGOPTS @10.53.0.4 -p 5300 noixfr SOA > dig.out.ns4.test$n
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graffgrep "status: NOERROR" dig.out.ns4.test$n > /dev/null || ret=1
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrencegrep "ANSWER: 1," dig.out.ns4.test$n > /dev/null || ret=1
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graffgrep "2011072400" dig.out.ns4.test$n > /dev/null || ret=1
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graffecho "I:checking YYYYMMDDVV (2011072400) serial in signed zone, noixfr ($n)"
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff $DIG $DIGOPTS @10.53.0.3 -p 5300 noixfr SOA > dig.out.ns3.test$n
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ret=1
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff grep "ANSWER: 2," dig.out.ns3.test$n > /dev/null || ret=1
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff grep "2011072400" dig.out.ns3.test$n > /dev/null || ret=1
74889a341cac183d477e15cfead391a8f7bdba95Michael Graffecho "I:stop bump in the wire signer server ($n)"
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graffecho "I:restart bump in the wire signer server ($n)"
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff$PERL ../start.pl --noclean --restart . ns3 || ret=1
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graffserver 10.53.0.2 5300
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graffupdate add bits 0 SOA ns2.bits. . 2011072450 20 20 1814400 3600
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graffecho "I:checking YYYYMMDDVV (2011072450) serial on hidden master ($n)"
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff$DIG $DIGOPTS @10.53.0.2 -p 5300 bits SOA > dig.out.ns2.test$n
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graffgrep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
e24f605ad64182532640dc6721070456b13112d5Michael Graffgrep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
e24f605ad64182532640dc6721070456b13112d5Michael Graffgrep "2011072450" dig.out.ns2.test$n > /dev/null || ret=1
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graffecho "I:checking YYYYMMDDVV (2011072450) serial in signed zone ($n)"
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff $DIG $DIGOPTS @10.53.0.3 -p 5300 bits SOA > dig.out.ns3.test$n
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ret=1
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff grep "ANSWER: 2," dig.out.ns3.test$n > /dev/null || ret=1
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff grep "2011072450" dig.out.ns3.test$n > /dev/null || ret=1
$NSUPDATE << EOF
n=`expr $n + 1`
n=`expr $n + 1`
$NSUPDATE << EOF
n=`expr $n + 1`
n=`expr $n + 1`
$NSUPDATE << EOF
n=`expr $n + 1`
n=`expr $n + 1`
n=`expr $n + 1`
exit $status