tests.sh revision 0f5144163c44a67d9be986383769852a0dae502a
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#!/bin/sh
a7038d1a0513c8e804937ebc95fc9cb3a46c04f5Mark Andrews#
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence# Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley# Permission to use, copy, modify, and/or distribute this software for any
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley# purpose with or without fee is hereby granted, provided that the above
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence# copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence#
15a44745412679c30a6d022733925af70a38b715David Lawrence# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
15a44745412679c30a6d022733925af70a38b715David Lawrence# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15a44745412679c30a6d022733925af70a38b715David Lawrence# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15a44745412679c30a6d022733925af70a38b715David Lawrence# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15a44745412679c30a6d022733925af70a38b715David Lawrence# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15a44745412679c30a6d022733925af70a38b715David Lawrence# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15a44745412679c30a6d022733925af70a38b715David Lawrence# PERFORMANCE OF THIS SOFTWARE.
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
5619558151f1aa4249b3ead979e76876e29278b6Bob HalleySYSTEMTESTTOP=..
def8e47c688e2480a4539d69c3d1a0a28a7c0550Mark Andrews. $SYSTEMTESTTOP/conf.sh
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence
110d1702731f42dd620879c1d765ebe91f3920ceMichael Graffstatus=0
110d1702731f42dd620879c1d765ebe91f3920ceMichael Graffn=0
c3b708aaf1bb0a118e0e11befa1b732acfb1d079Bob Halleyzone=.
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrencen=`expr $n + 1`
def8e47c688e2480a4539d69c3d1a0a28a7c0550Mark Andrewsecho "I:check +edns=100 sets version 100 ($n)"
364a82f7c25b62967678027043425201a5e5171aBob Halleyret=0 reason=
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley$DIG -p 5300 @10.53.0.1 +qr +norec +edns=100 soa $zone > dig.out$n
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrencegrep "EDNS: version: 100," dig.out$n > /dev/null || { ret=1; reason="version"; }
8dfa9caeec8e68db0c937e347a3d6629e7627d54Bob Halleyif [ $ret != 0 ]; then echo "I:failed $reason"; fi
54f959d12b5a1f9315fbf6a776c6d349316e9686Bob Halleystatus=`expr $status + $ret`
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrewsn=`expr $n + 1`
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyret=0 reason=
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyecho "I:check +ednsopt=100 adds option 100 ($n)"
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley$DIG -p 5300 @10.53.0.1 +qr +norec +ednsopt=100 soa $zone > dig.out$n
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "; OPT=100" dig.out$n > /dev/null || { ret=1; reason="option"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyif [ $ret != 0 ]; then echo "I:failed $reason"; fi
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleystatus=`expr $status + $ret`
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyn=`expr $n + 1`
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyecho "I:check +ednsflags=0x80 sets flags to 0080 ($n)"
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyret=0 reason=
078d49b63324f01d98301ee21671abee0c41fcdeBob Halley$DIG -p 5300 @10.53.0.1 +qr +norec +ednsflags=0x80 soa $zone > dig.out$n
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "MBZ: 0080" dig.out$n > /dev/null || { ret=1; reason="flags"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyif [ $ret != 0 ]; then echo "I:failed $reason"; fi
904a5734375869ffb504ed8cde6b68cafadb6d64Bob Halleystatus=`expr $status + $ret`
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyn=`expr $n + 1`
ca67883a666bdf314d3da958d5195e7215b1f797Bob Halleyecho "I:Unknown EDNS version ($n)"
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halleyret=0 reason=
b12f0228b32775ee688ed21ddbf3a116c1adfb43Michael Graff$DIG -p 5300 @10.53.0.1 +norec +edns=100 +noednsneg soa $zone > dig.out$n
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "status: BADVERS," dig.out$n > /dev/null || { ret=1; reason="status"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "EDNS: version: 0," dig.out$n > /dev/null || { ret=1; reason="version"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "IN.SOA." dig.out$n > /dev/null && { ret=1; reaons="soa"; }
e496615043400500492fa7b891c515c8e7cb7d08Bob Halleyif [ $ret != 0 ]; then echo "I:failed $reason"; fi
e496615043400500492fa7b891c515c8e7cb7d08Bob Halleystatus=`expr $status + $ret`
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyn=`expr $n + 1`
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyecho "I:Unknown EDNS option ($n)"
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyret=0 reason=
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley$DIG -p 5300 @10.53.0.1 +norec +ednsopt=100 soa $zone > dig.out$n
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "status: NOERROR," dig.out$n > /dev/null || { ret=1; reason="status"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "EDNS: version: 0," dig.out$n > /dev/null || { ret=1; reason="version"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "; OPT=100" dig.out$n > /dev/null && { ret=1; reason="option"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "IN.SOA." dig.out$n > /dev/null || { ret=1; reason="nosoa"; }
078d49b63324f01d98301ee21671abee0c41fcdeBob Halleyif [ $ret != 0 ]; then echo "I:failed $reason"; fi
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleystatus=`expr $status + $ret`
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyn=`expr $n + 1`
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyecho "I:Unknown EDNS version + option ($n)"
904a5734375869ffb504ed8cde6b68cafadb6d64Bob Halleyret=0 reason=
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley$DIG -p 5300 @10.53.0.1 +norec +edns=100 +noednsneg +ednsopt=100 soa $zone > dig.out$n
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "status: BADVERS," dig.out$n > /dev/null || { ret=1; reason="status"; }
ca67883a666bdf314d3da958d5195e7215b1f797Bob Halleygrep "EDNS: version: 0," dig.out$n > /dev/null || { ret=1; reason="version"; }
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halleygrep "; OPT=100" dig.out$n > /dev/null && { ret=1; reason="option"; }
b12f0228b32775ee688ed21ddbf3a116c1adfb43Michael Graffgrep "IN.SOA." dig.out$n > /dev/null && { ret=1; reason="soa"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyif [ $ret != 0 ]; then echo "I:failed: $reason"; fi
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleystatus=`expr $status + $ret`
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyn=`expr $n + 1`
e496615043400500492fa7b891c515c8e7cb7d08Bob Halley
e496615043400500492fa7b891c515c8e7cb7d08Bob Halleyecho "I:Unknown EDNS flag ($n)"
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyret=0 reason=
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley$DIG -p 5300 @10.53.0.1 +norec +ednsflags=0x80 soa $zone > dig.out$n
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "status: NOERROR," dig.out$n > /dev/null || { ret=1; reason="status"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "EDNS: version: 0," dig.out$n > /dev/null || { ret=1; reason="version"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "EDNS:.*MBZ" dig.out$n > /dev/null > /dev/null && { ret=1; reason="mbz"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep ".IN.SOA." dig.out$n > /dev/null || { ret=1; reason="nosoa"; }
2cd0c38115b1efb043ed3104c0d08e51ceade0d7Bob Halleyif [ $ret != 0 ]; then echo "I:failed $reason"; fi
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleystatus=`expr $status + $ret`
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
078d49b63324f01d98301ee21671abee0c41fcdeBob Halleyn=`expr $n + 1`
0180ccf72c79b98eb8ee5abbb7331aec6951dd9fBob Halleyecho "I:Unknown EDNS version + flag ($n)"
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyret=0 reason=
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley$DIG -p 5300 @10.53.0.1 +norec +edns=100 +noednsneg +ednsflags=0x80 soa $zone > dig.out$n
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "status: BADVERS," dig.out$n > /dev/null || { ret=1; reason="status"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "EDNS: version: 0," dig.out$n > /dev/null || { ret=1; reason="version"; }
904a5734375869ffb504ed8cde6b68cafadb6d64Bob Halleygrep "EDNS:.*MBZ" dig.out$n > /dev/null > /dev/null && { ret=1; reason="mbz"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "IN.SOA." dig.out$n > /dev/null && { ret=1; reason="soa"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyif [ $ret != 0 ]; then echo "I:failed $reason"; fi
ca67883a666bdf314d3da958d5195e7215b1f797Bob Halleystatus=`expr $status + $ret`
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halleyn=`expr $n + 1`
b12f0228b32775ee688ed21ddbf3a116c1adfb43Michael Graff
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyecho "I:DiG's EDNS negotiation ($n)"
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyret=0 reason=
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley$DIG -p 5300 @10.53.0.1 +norec +edns=100 soa $zone > dig.out$n
e496615043400500492fa7b891c515c8e7cb7d08Bob Halleygrep "status: NOERROR," dig.out$n > /dev/null || { ret=1; reason="status"; }
e496615043400500492fa7b891c515c8e7cb7d08Bob Halleygrep "EDNS: version: 0," dig.out$n > /dev/null || { ret=1; reason="version"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleygrep "IN.SOA." dig.out$n > /dev/null || { ret=1; reason="soa"; }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleyif [ $ret != 0 ]; then echo "I:failed $reason"; fi
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halleystatus=`expr $status + $ret`
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halleyn=`expr $n + 1`
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halleyecho "I:exit status: $status"
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halleyexit $status
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence