1#!/bin/sh 2# 3# Copyright (C) 2013, 2014 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 17SYSTEMTESTTOP=.. 18. $SYSTEMTESTTOP/conf.sh 19 20DIGOPTS="+tcp +nosea +nostat +noquest +nocomm +nocmd" 21 22status=0 23n=0 24 25n=`expr $n + 1` 26echo "I:waiting for zone transfer to complete ($n)" 27ret=0 28for i in 1 2 3 4 5 6 7 8 9 29do 30 $DIG $DIGOPTS soa example. @10.53.0.2 -p 5300 > dig.ns2.test$n 31 grep SOA dig.ns2.test$n > /dev/null && break 32done 33 34n=`expr $n + 1` 35echo "I:testing case preserving responses - no acl ($n)" 36ret=0 37$DIG $DIGOPTS mx example. @10.53.0.1 -p 5300 > dig.ns1.test$n 38grep "0.mail.eXaMpLe" dig.ns1.test$n > /dev/null || ret=1 39grep "mAiL.example" dig.ns1.test$n > /dev/null || ret=1 40test $ret -eq 0 || echo "I:failed" 41status=`expr $status + $ret` 42 43n=`expr $n + 1` 44echo "I:testing no-case-compress acl '{ 10.53.0.2; }' ($n)" 45ret=0 46 47# check that we preserve zone case for non-matching query (10.53.0.1) 48$DIG $DIGOPTS mx example. -b 10.53.0.1 @10.53.0.1 -p 5300 > dig.ns1.test$n 49grep "0.mail.eXaMpLe" dig.ns1.test$n > /dev/null || ret=1 50grep "mAiL.example" dig.ns1.test$n > /dev/null || ret=1 51 52# check that we don't preserve zone case for match (10.53.0.2) 53$DIG $DIGOPTS mx example. -b 10.53.0.2 @10.53.0.2 -p 5300 > dig.ns2.test$n 54grep "0.mail.example" dig.ns2.test$n > /dev/null || ret=1 55grep "mail.example" dig.ns2.test$n > /dev/null || ret=1 56 57test $ret -eq 0 || echo "I:failed" 58status=`expr $status + $ret` 59 60echo "I:exit status: $status" 61exit $status 62