1#!/bin/sh 2# 3# Copyright (C) 2012, 2013 Internet Systems Consortium, Inc. ("ISC") 4# 5# Permission to use, copy, modify, and/or distribute this software for any 6# purpose with or without fee is hereby granted, provided that the above 7# copyright notice and this permission notice appear in all copies. 8# 9# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15# PERFORMANCE OF THIS SOFTWARE. 16 17# Id: tests.sh,v 1.1.2.3 2010/06/01 06:57:31 marka Exp 18 19SYSTEMTESTTOP=.. 20. $SYSTEMTESTTOP/conf.sh 21 22status=0 23n=0 24 25rm -f dig.out.* 26 27DIGOPTS="+tcp +noadd +nosea +nostat +nocmd +dnssec -p 5300" 28 29n=`expr $n + 1` 30echo "I: checking that NSEC wildcard non-existance proof is returned auth ($n)" 31ret=0 32$DIG $DIGOPTS a b.wild.nsec +norec @10.53.0.1 > dig.out.ns1.test$n || ret=1 33grep -i 'a\.wild\.nsec\..*NSEC.*nsec\..*NSEC' dig.out.ns1.test$n > /dev/null || ret=1 34if [ $ret != 0 ]; then echo "I:failed"; fi 35status=`expr $status + $ret` 36 37n=`expr $n + 1` 38echo "I: checking that NSEC wildcard non-existance proof is returned non-validating ($n)" 39ret=0 40$DIG $DIGOPTS a b.wild.nsec @10.53.0.2 > dig.out.ns2.test$n || ret=1 41grep -i 'a\.wild\.nsec\..*NSEC.*nsec\..*NSEC' dig.out.ns2.test$n > /dev/null || ret=1 42grep -i 'flags:.* ad[ ;]' dig.out.ns2.test$n > /dev/null && ret=1 43if [ $ret != 0 ]; then echo "I:failed"; fi 44status=`expr $status + $ret` 45 46n=`expr $n + 1` 47echo "I: checking that NSEC wildcard non-existance proof is returned validating ($n)" 48ret=0 49$DIG $DIGOPTS a b.wild.nsec @10.53.0.3 > dig.out.ns3.test$n || ret=1 50grep -i 'a\.wild\.nsec\..*NSEC.*nsec\..*NSEC' dig.out.ns3.test$n > /dev/null || ret=1 51grep -i 'flags:.* ad[ ;]' dig.out.ns3.test$n > /dev/null || ret=1 52if [ $ret != 0 ]; then echo "I:failed"; fi 53status=`expr $status + $ret` 54 55n=`expr $n + 1` 56echo "I: checking that NSEC wildcard non-existance proof is returned validating + CD ($n)" 57ret=0 58$DIG $DIGOPTS +cd a b.wild.nsec @10.53.0.5 > dig.out.ns5.test$n || ret=1 59grep -i 'a\.wild\.nsec\..*NSEC.*nsec\..*NSEC' dig.out.ns5.test$n > /dev/null || ret=1 60grep -i 'flags:.* ad[ ;]' dig.out.ns5.test$n > /dev/null && ret=1 61if [ $ret != 0 ]; then echo "I:failed"; fi 62status=`expr $status + $ret` 63n=`expr $n + 1` 64 65echo "I: checking that returned NSEC wildcard non-existance proof validates ($n)" 66ret=0 67$DIG $DIGOPTS a b.wild.nsec @10.53.0.4 > dig.out.ns4.test$n || ret=1 68grep -i 'a\.wild\.nsec\..*NSEC.*nsec\..*NSEC' dig.out.ns4.test$n > /dev/null || ret=1 69grep -i 'flags:.* ad[ ;]' dig.out.ns4.test$n > /dev/null || ret=1 70if [ $ret != 0 ]; then echo "I:failed"; fi 71status=`expr $status + $ret` 72 73n=`expr $n + 1` 74echo "I: checking that NSEC wildcard non-existance proof is returned private, validating ($n)" 75ret=0 76$DIG $DIGOPTS a b.wild.private.nsec @10.53.0.3 > dig.out.ns3.test$n || ret=1 77grep -i 'a\.wild\.private\.nsec\..*NSEC.*private\.nsec\..*NSEC' dig.out.ns3.test$n > /dev/null || ret=1 78grep -i 'flags:.* ad[ ;]' dig.out.ns3.test$n > /dev/null && ret=1 79if [ $ret != 0 ]; then echo "I:failed"; fi 80status=`expr $status + $ret` 81 82n=`expr $n + 1` 83echo "I: checking that returned NSEC wildcard non-existance proof for private zone validates ($n)" 84ret=0 85$DIG $DIGOPTS a b.wild.private.nsec @10.53.0.4 > dig.out.ns4.test$n || ret=1 86grep -i 'a\.wild\.private\.nsec\..*NSEC.*private\.nsec\..*NSEC' dig.out.ns4.test$n > /dev/null || ret=1 87grep -i 'flags:.* ad[ ;]' dig.out.ns4.test$n > /dev/null || ret=1 88if [ $ret != 0 ]; then echo "I:failed"; fi 89status=`expr $status + $ret` 90 91n=`expr $n + 1` 92echo "I: checking that NSEC3 wildcard non-existance proof is returned auth ($n)" 93ret=0 94$DIG $DIGOPTS a b.wild.nsec3 +norec @10.53.0.1 > dig.out.ns1.test$n || ret=1 95grep -i 'O3TJ8D9AJ54CBTFCQCJ3QK49CH7SF6H9\.nsec3\..*V5DLFB6UJNHR94LQ61FO607KGK12H88A' dig.out.ns1.test$n > /dev/null || ret=1 96if [ $ret != 0 ]; then echo "I:failed"; fi 97status=`expr $status + $ret` 98 99n=`expr $n + 1` 100echo "I: checking that NSEC3 wildcard non-existance proof is returned non-validating ($n)" 101ret=0 102$DIG $DIGOPTS a b.wild.nsec3 @10.53.0.2 > dig.out.ns2.test$n || ret=1 103grep -i 'O3TJ8D9AJ54CBTFCQCJ3QK49CH7SF6H9\.nsec3\..*V5DLFB6UJNHR94LQ61FO607KGK12H88A' dig.out.ns2.test$n > /dev/null || ret=1 104grep -i 'flags:.* ad[ ;]' dig.out.ns2.test$n > /dev/null && ret=1 105if [ $ret != 0 ]; then echo "I:failed"; fi 106status=`expr $status + $ret` 107 108n=`expr $n + 1` 109echo "I: checking that NSEC3 wildcard non-existance proof is returned validating ($n)" 110ret=0 111$DIG $DIGOPTS a b.wild.nsec3 @10.53.0.3 > dig.out.ns3.test$n || ret=1 112grep -i 'O3TJ8D9AJ54CBTFCQCJ3QK49CH7SF6H9\.nsec3\..*V5DLFB6UJNHR94LQ61FO607KGK12H88A' dig.out.ns3.test$n > /dev/null || ret=1 113grep -i 'flags:.* ad[ ;]' dig.out.ns3.test$n > /dev/null || ret=1 114if [ $ret != 0 ]; then echo "I:failed"; fi 115status=`expr $status + $ret` 116 117n=`expr $n + 1` 118echo "I: checking that NSEC3 wildcard non-existance proof is returned validating + CD ($n)" 119ret=0 120$DIG $DIGOPTS +cd a b.wild.nsec3 @10.53.0.5 > dig.out.ns5.test$n || ret=1 121grep -i 'O3TJ8D9AJ54CBTFCQCJ3QK49CH7SF6H9\.nsec3\..*V5DLFB6UJNHR94LQ61FO607KGK12H88A' dig.out.ns5.test$n > /dev/null || ret=1 122grep -i 'flags:.* ad[ ;]' dig.out.ns5.test$n > /dev/null && ret=1 123if [ $ret != 0 ]; then echo "I:failed"; fi 124status=`expr $status + $ret` 125 126n=`expr $n + 1` 127echo "I: checking that returned NSEC3 wildcard non-existance proof validates ($n)" 128ret=0 129$DIG $DIGOPTS a b.wild.nsec3 @10.53.0.4 > dig.out.ns4.test$n || ret=1 130grep -i 'O3TJ8D9AJ54CBTFCQCJ3QK49CH7SF6H9\.nsec3\..*V5DLFB6UJNHR94LQ61FO607KGK12H88A' dig.out.ns4.test$n > /dev/null || ret=1 131grep -i 'flags:.* ad[ ;]' dig.out.ns4.test$n > /dev/null || ret=1 132if [ $ret != 0 ]; then echo "I:failed"; fi 133status=`expr $status + $ret` 134 135n=`expr $n + 1` 136echo "I: checking that NSEC3 wildcard non-existance proof is returned private, validating ($n)" 137ret=0 138$DIG $DIGOPTS a b.wild.private.nsec3 @10.53.0.3 > dig.out.ns3.test$n || ret=1 139grep -i 'UDBSP4R8OUOT6HSO39VD8B5LMOSHRD5N\.private\.nsec3\..*NSEC3.*ASDRUIB7GO00OR92S5OUGI404LT27RNU' dig.out.ns3.test$n > /dev/null || ret=1 140grep -i 'flags:.* ad[ ;]' dig.out.ns3.test$n > /dev/null && ret=1 141if [ $ret != 0 ]; then echo "I:failed"; fi 142status=`expr $status + $ret` 143 144n=`expr $n + 1` 145echo "I: checking that returned NSEC3 wildcard non-existance proof for private zone validates ($n)" 146ret=0 147$DIG $DIGOPTS a b.wild.private.nsec3 @10.53.0.4 > dig.out.ns4.test$n || ret=1 148grep -i 'UDBSP4R8OUOT6HSO39VD8B5LMOSHRD5N\.private\.nsec3\..*NSEC3.*ASDRUIB7GO00OR92S5OUGI404LT27RNU' dig.out.ns4.test$n > /dev/null || ret=1 149grep -i 'flags:.* ad[ ;]' dig.out.ns4.test$n > /dev/null || ret=1 150if [ $ret != 0 ]; then echo "I:failed"; fi 151status=`expr $status + $ret` 152 153echo "I:exit status: $status" 154exit $status 155